Page 1 of 1

Keypad flowchart samples for begginers

Posted: Sat Jun 06, 2009 5:27 pm
by kilopondio
Hi people!,

I just need some keypad flowchart in difficulties steps to be able to get into this stuff.where can I get these in the forum?

Thank you all and have a nice weekend!.

KIlopondio

Re: Keypad flowchart samples for begginers

Posted: Mon Jun 08, 2009 8:30 am
by Sean
Here is a simple program that reads the keypad and displays the resulting value on a bank of LEDs.
Keypad2LED.fcf
(5.5 KiB) Downloaded 453 times
When a keypad read macro is executed, the keypad is scanned immediately. If no keys are being pressed the value 255 is returned. If a key is being pressed, the value of the key is returned.
The GetKeypadNumber macro returns the numeric value of the key cap (* = 10, # = 11)
The GetKeypadAscii macro returns the ASCII value of the key cap character - for use in strings, or direct display on the LCD.

When the example program detects a key press, it displays the value on the LEDs and enters a loop which continually reads the keypad until the key has been released (return value = 255). This can be useful in some applications to prevent multiple detection of the same keypress.

Re: Keypad flowchart multiple entry of keys

Posted: Wed Jun 10, 2009 10:57 pm
by Woode
The code given to stop multiple entry of keys traps the program in a loop.
It is never a good idea to trap programs in a loop as they cannot do anything else until released.

This code stops the multiple entry but does not trap the program in a loop.

Delays do the same, it is better to use an interrupt. This is covered in other posts.