View Full Version : store numbers of a 4x4 keypad with BS2

02-10-2010, 02:33 AM
Hi, i need some help.

i try to store keys of a 4x4 keypad with a BS2, the idea is enter 5-digits numbers and stored in a variable word like a single number.
i working with the code that appears in nuts and volts 22 "Scan a Keypad with the BS2For Pushbutton User Input" by Scott Edwars.


Mike Green
02-10-2010, 02:49 AM
What is your question? The code in the Nuts and Volts Column is pretty straightforward and provides a key number which you can translate to a numeric value. Typically you use the digits "0" through "9" for their values, the "*" for a backspace key and the "#" for an enter key. If your number is stored in Value and the key value is stored in Key, you'd have "Value = Value * 10 + Key" for each key entered and you'd have "Value = Value / 10" for a backspace ("*"). Obviously, you'd want to check whether there are too many digits entered or too many "*" entered.

02-10-2010, 03:07 AM
Ok, mike i try with that.

thanks ....