cica
05-24-2006, 10:51 PM
Hi-
I've been combing this forum as well as other resources and I can't seem to find an answer to this one.
I have a BS2 that has 4 buttons on P0-P3. I've used the debounce code to determine which of the 4 buttons are being pressed, and before reinventing the wheel, I was wondering if anyone has already written a routine to extract a 4-digit code from keypresses.
Specifically, I'm looking for a timer to start upon the first keypress, and if there aren't 4 button presses within 20 seconds, to clear all button presses from memory. I'm also trying to avoid keypress repeats. In this area, I was thinking of not allowing a 2nd, 3rd, 4th press to be recorded until the previous button registers as being released. I'm planning on giving feedback to the user that each keypress has been accepted via the LCD.
I'm pretty sure I can write this, but I'll probably end up filling up the stamps memory http://forums.parallax.com/images/smilies/burger.gif
Thanks,
-Tom
I've been combing this forum as well as other resources and I can't seem to find an answer to this one.
I have a BS2 that has 4 buttons on P0-P3. I've used the debounce code to determine which of the 4 buttons are being pressed, and before reinventing the wheel, I was wondering if anyone has already written a routine to extract a 4-digit code from keypresses.
Specifically, I'm looking for a timer to start upon the first keypress, and if there aren't 4 button presses within 20 seconds, to clear all button presses from memory. I'm also trying to avoid keypress repeats. In this area, I was thinking of not allowing a 2nd, 3rd, 4th press to be recorded until the previous button registers as being released. I'm planning on giving feedback to the user that each keypress has been accepted via the LCD.
I'm pretty sure I can write this, but I'll probably end up filling up the stamps memory http://forums.parallax.com/images/smilies/burger.gif
Thanks,
-Tom