Shop OBEX P1 Docs P2 Docs Learn Events
4x4 keypad connected EDE1144 keypad encoder — Parallax Forums

4x4 keypad connected EDE1144 keypad encoder

pasosonpasoson Posts: 3
edited 2012-02-19 08:22 in BASIC Stamp
I am a newbie in the world of programming so please excuse my ignorance. I am currently working on a basic(simple) home security system using a bs2 microcontroller, serial lcd , three sensors(reed switch, impact sensor, PIR sensor) and a 4x4 keypad connected to a ede1144 keypad encoder. I am lost trying to write a subroutine that would allow a first time user to enter the desired 4 digit security pin ,store it to memory and call the code chosen by the user when attempting to disarm the system.


Step by step list of what I am attempting to do:

1) Display welcome message
2) Ask the user to enter their desired 4 digit pin
3) Store it temporarily somewhere
4) Ask the user to re-enter their desired pin
5) If they match then store it to memory

Because I am using a keypad (parallax item number 27899) connected to the EDE1144 encoder I am able to enter a four digit for the user code but getting the corresponding value on the keypad itself is eluding me. Could anyone provide me some constructive feedback.

Comments

  • Clive WakehamClive Wakeham Posts: 152
    edited 2012-02-18 21:36
    The issue you have is that the Parallax keypad layout (and wiring) is different to what the EDE 1144 encoder expects. Pull up the pdf file on the keypad and on the EDE 1144 encoder (available via a google search) and see the difference.

    You might need to modify your program so it accepts the value from the encoder and then changes it to the correct value, using lookup and lookdown.
  • pasosonpasoson Posts: 3
    edited 2012-02-18 21:50
    I appreciate feedback but I already tried that. Right now I am able to get just a single digit at a time rather than the 4 digit code.
  • Clive WakehamClive Wakeham Posts: 152
    edited 2012-02-19 02:50
    The EDE 1144 encoder sends the code for a single key press via the serial line or via 4bit paralllel lines, it is up to the Basic Stamp to get this data, store it, then collect the next keypress data, store it, etc etc.

    How is the EDE 1144 encoder connect to the Basic Stamp? Serial or Parallel?
  • pasosonpasoson Posts: 3
    edited 2012-02-19 08:22
    Is connected in serial. here is an sample of the code I am using.
    SEROUT lcdPin, Baud, [12]                               ' Clear Display
    SEROUT LCDpin, Baud, [outkey, " "]                ' Display It On The LCD Display
    COUNT keypad, 1 - 4, outkey
    KeyScan:
    DO : LOOP WHILE KeyRdy = 1                        ' Wait Until Data Valid
    SERIN KeyPad, KeyBaud, [inKey]                    ' Get Key Value
    inKey = inKey - 48                                             ' Remove ASCII Value Offset
    IF inKey < 10 THEN KeyScan2                         ' Key Is 0 - 9
    inKey = inKey - 7                                               ' Key Is A - F, Remove ASCII Offset
    KeyScan2:
    LOOKUP inKey, [49, 50, 51, 65, 52, 53, 54, 66,
    55, 56, 57, 67, 42, 48, 35, 68], outKey
    RETURN
    
Sign In or Register to comment.