Shop OBEX P1 Docs P2 Docs Learn Events
store numbers of a 4x4 keypad with BS2 — Parallax Forums

store numbers of a 4x4 keypad with BS2

JAGOJAGO Posts: 49
edited 2010-02-09 20:07 in BASIC Stamp
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.

thanks!

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2010-02-09 19:49
    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.
  • JAGOJAGO Posts: 49
    edited 2010-02-09 20:07
    Ok, mike i try with that.

    thanks ....
Sign In or Register to comment.