Using the sparkfun 12 Button keypad, with the arduino

 by amando96

Step 2: Code

 Removed directly from the arduino.cc website, the only mod, was the pins i chose...
the code is attached, instructables won't let me paste it onto here for some reason...

The code will print the numbers of they keys you pressed, to the COM port.
also, be sure to have the library ''keypad'' in your libraries folder, or this code will not compile.

To use similar, but not equal keypads, just grab your continuity tester, and press those buttons, you will easily find wich pins are for the rows, and wich are for the columns.


IF you need any help, just ask in the comments :)





 
Remove these adsRemove these ads by Signing Up
jcameron-1 says: Jan 22, 2013. 11:37 AM
Thank you for this tutorial. I'm a Arduino newbie, so it was exactly what I was looking for to continue my vending project for my son. I was wondering if you had any examples of how to make a servo rotate if a correct "code" is put into the keypad? I've been searching like crazy but haven't come across any examples.
amando96 (author) in reply to jcameron-1Jan 22, 2013. 12:26 PM
Put the keys into an array, compare the array to a predefined array of the "correct" code with an if statement, if equal then rotate servo, if not beep or whatever, take things by parts, break down big algorithms into small algorithms and you have no trouble doing anything.
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!