Shop OBEX P1 Docs P2 Docs Learn Events
Schematic and bs2 file, Help, Post your thoughts please Mike — Parallax Forums

Schematic and bs2 file, Help, Post your thoughts please Mike

BuGeYeSBuGeYeS Posts: 6
edited 2010-05-29 23:27 in BASIC Stamp
···· I assembled this unit as per the diagram using various N+V articles. 4-bit LCD mode works fine and keypad works·for single digit input·but need a little·help please for multiple digits. Another question, can i change the keypad routine some for a 4R X 3C keypad? Iwould like to drop the pullup resistor from pin 15. However, I2C·is·working.·· Note: I am actually using a bs2 homework board Rev. B

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2010-05-29 23:27
    What do you want to do with multiple digits? You say that the keypad works and presumably provides a number from 0-11. If you want to enter a 16 bit decimal value and use the extra two keys for "enter" and "delete", you will need a subroutine called by your program that, in turn, calls the keypad routine to get the keypresses (newKey) and exits when the "enter" key is pressed. If you get a digit (assume from 0-9), you'd do something like:

    value = value * 10 + newKey

    If you get a "delete", you'd do something like:

    value = value / 10

    Note that the above does no error checking or checking for overflow. You'd want to add that sort of thing.

    "value" is a word variable initialized to zero and used to accumulate the entered value.

    Your circuit is already set up for a 4 x 3 keypad. You can use the same logic for any number of rows and columns.
Sign In or Register to comment.