Keypad flowchart samples for begginers

For E-blocks user to discuss using E-blocks and programming for them.

Moderators: Benj, Mods

Post Reply
kilopondio
Posts: 11
Joined: Tue Feb 13, 2007 10:06 pm
Contact:

Keypad flowchart samples for begginers

Post 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

Sean
Valued Contributor
Valued Contributor
Posts: 548
Joined: Tue Jun 26, 2007 11:23 am
Has thanked: 6 times
Been thanked: 44 times
Contact:

Re: Keypad flowchart samples for begginers

Post 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 454 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.

Woode
Posts: 10
Joined: Fri Dec 26, 2008 4:11 pm
Been thanked: 2 times
Contact:

Re: Keypad flowchart multiple entry of keys

Post 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.
Attachments
Keypad2LED-M1.fcf
(6 KiB) Downloaded 402 times

Post Reply