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
Keypad flowchart samples for begginers
-
- Valued Contributor
- Posts: 548
- Joined: Tue Jun 26, 2007 11:23 am
- Has thanked: 6 times
- Been thanked: 44 times
Re: Keypad flowchart samples for begginers
Here is a simple program that reads the keypad and displays the resulting value on a bank of LEDs.
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.
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
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.
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.
- Attachments
-
- Keypad2LED-M1.fcf
- (6 KiB) Downloaded 420 times