Shop OBEX P1 Docs P2 Docs Learn Events
Reading a keypad with an MCP23016 — Parallax Forums

Reading a keypad with an MCP23016

NewzedNewzed Posts: 2,503
edited 2005-04-13 02:34 in Robotics
Here is a tidy little program that will let you read the state of a keypad having up to 16 buttons.· We used a 12-button keypad - BG Micro SWT1068.· Keypads must have a common ground with lines for each button.· All buttons are held high with a 10K resistor to Vdd.· The program contains all the connections for the MCP23016 and the keypad.· This is for a bus type keypad only - it won't work with a matrix keypad.

The program uses only two I/O ports - 8 and 9 - and has only·two 1-byte variables.· It is written for the BS2P, but I have a modified code for the BS2/BSE if you need it.· I used my MCP23016 piggyback but any breadboard configuration will work just as well.


·

Post Edited By Moderator (Jon Williams) : 4/12/2005 11:07:46 PM GMT

Comments

  • dandreaedandreae Posts: 1,375
    edited 2005-04-12 17:52
    Sid,

    Add a schematic to this and post it under "Projects".· This project is very popular, thank you for posting this.

    Dave

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dave Andreae

    Tech Support
    dandreae@parallax.com
    www.parallax.com

    ·
  • NewzedNewzed Posts: 2,503
    edited 2005-04-12 18:16
    Dan, the only medium I have for making a decent schematic is ExpressPCB, and you can't copy and paste things from there.· Maybe I could take a screen shot and then post that.

    Sid
  • MrdavidjenkinsMrdavidjenkins Posts: 49
    edited 2005-04-13 01:28
    This looks very handy and any code or documentation you could provide will be much appreciated by a lot of people.· Thanks for the post
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-04-13 02:34
    ·· Yeah, Sid's one of our home-brew hackers who manages to get more projects done in a week than I do in a· month!· LOL· I see the schematic made it online.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
Sign In or Register to comment.