Shop OBEX P1 Docs P2 Docs Learn Events
Exploring Cutting Edge Technology With the Parallax 4x4 Matrix Membrane Keypad (#27899) - Page 2 — Parallax Forums

Exploring Cutting Edge Technology With the Parallax 4x4 Matrix Membrane Keypad (#27899)

2»

Comments

  • microcontrollerusermicrocontrolleruser Posts: 1,194
    edited 2018-12-02 06:38
    Going to move the hardware from the BOE over to the PDB.

    Disconnected hardware from Stamp and program kept churning.

    Will try it again after connecting up hardware on PDB.

    This one BS2 module says Rev J

    Is that the last revision?

    J sounds like a lot of revisions.

  • Okay.Pulled the plug on this and moving on.

    Code seems to be no good.

    Don't have time to debug somebody else's code.
  • microcontrolleruser,

    What's wrong with the code?

  • Genetix

    It appears not to work.

    It's not a copy and paste error either.

    Here's a copy ready to run.

    https://www.parallax.com/downloads/matrix-keypad-basic-stamp-code

    If you want to assemble the circuit and see if this code is good, go ahead but that's it for me.

    Happy Holidays!
  • Most revisions have been due to manufacturing changes over the years. Sometimes there have been improvements like the addition of a separate brown-out detector rather than using the one built into the PIC.
  • microcontrollerusermicrocontrolleruser Posts: 1,194
    edited 2018-12-02 16:50
    Thanks Mike

    This one has more ads silkscreened on the back than I have ever seen on a Parallax board.

    2006 copyright.

    I done gave up on that program.

    No big deal. Getting a different keypad in a week or two.

    Will write my own program for it.
  • PublisonPublison Posts: 12,366
    edited 2018-12-02 17:55
    Genetix

    It appears not to work.

    It's not a copy and paste error either.

    Here's a copy ready to run.

    https://www.parallax.com/downloads/matrix-keypad-basic-stamp-code

    If you want to assemble the circuit and see if this code is good, go ahead but that's it for me.

    Happy Holidays!

    Sometimes when I cut-paste BS2 programs, I have to go back and add the directives again at the top,
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    and then it will work. Try that.
  • microcontrollerusermicrocontrolleruser Posts: 1,194
    edited 2018-12-03 01:55
    Publison

    Will file that away for other sample programs from manuals.

    On this project I have closed the door.

    Took part off board and put them away.

    Maybe down the road sometime but probably not.

    Happy Holidays!
  • I didn't read the whole thread, but the BS2 has convenient IO nibbles that make reading a matrix keyboard pretty easy. I'm coding off the top of my head from work, but in the past I've done something like this:
    Scan_Keys:
      keys = 0                      ' clear reading
      FOR x = 0 to 3                ' read 4 columns
        FOR y = 0 to 3              ' read 4 rows
          OUTB = 1 << x             ' make 1 column high (others float)
          DIRB = 1 << x
          keys = keys << 4          ' prep for this nibble
          keys = keys | INA         ' grab it
          DIRB == 0                 ' disable columns outputs
        NEXT ' y
      NEXT ' x
      RETURN
    
    In case it's not obvious from the code, the INA pins (0..3) are inputs, and the OUTB pins (4..7) are outputs -- but only one at a time. Pins 0..3 should have 10K pull-downs on them. Easy-peasy.

    Final tip: You can check for specific key(s) bring pressed during a scan by creating mask constants for each.

  • microcontrolleruser,

    You were using the Parallax keypad, correct?

  • Thank you JonnyMac

    Will file that away for next time.

    Genetix

    Yes. The keypad in picture in first post.

    Other keypad should be here in a week or two.

Sign In or Register to comment.