Basically all I need is to connect a 4*4 keypad onto my arduino using the port from 8 to 13 that means that I have only 6 pins free on my arduino but I need 8 to connect the keypad. How can I do it :)? Also can I use pins 0 and 1 on my arduino since they are not being used by the lcd?
I would see if you can find one of these keypad drivers. They are obsolete, and have become expensive, but sometimes you can find them.
http://www.fairchildsemi.com/pf/MM/MM74C922.html
JImmy
Thanks for your help I was finally able to mount my keypad onto arduino ![]()
How'd you end up doing it?
Here's how I did it using the 74HC922
http://forum.arduino.cc/index.php?topic=211548.0
Why not just make a keypad that uses only one analog pin? I made a library just for those type of keypads and put it in the playground. Here is a link. OneWireKeypad
Just follow my diagram and look at my example sketches.
Let me guess, Resistor matrix, right ?
@HazardsMind,
PS- I used the 74hc922 because I had already bought it by the time I discovered your method.
Yea, but it works, look at the diagram.
Of course it works. How can it not . (Ohm's Law says it has to work) XD
True, but I mean others use set resistor values, mine allows the user to choose their own, just as long as the user tells the code what values are being used. The library does all the calculations and adjusts itself accordingly.
I used 4.7K and 1K resistor values, but that's only because I had a lot of them to spare.
insanehadi:
Basically all I need is to connect a 4*4 keypad onto my arduino using the port from 8 to 13 that means that I have only 6 pins free on my arduino but I need 8 to connect the keypad. How can I do it :)? Also can I use pins 0 and 1 on my arduino since they are not being used by the lcd?
The first question that comes to mind is: "Do you realize that analog pins can be used as digital pins?"
The first question that comes to mind is: "Do you realize that analog pins can be used as digital pins?"
Reply#5 gave the OP an example of that. It would appear he has not looked at it.
raschemmel:
The first question that comes to mind is: "Do you realize that analog pins can be used as digital pins?"
Reply#5 gave the OP an example of that. It would appear he has not looked at it.
Not really. That example used an analog pin as an analog pin, not as a digital pin.
It is possible to use an analog pin as a digital pin, and if two of them are unused, there's the 8 pins he needs.
If I understand correctly, he only needs eight pins if he uses the digital decoding scheme because as already pointed out, he only needs one analog pin for everything if he uses the analog scheme. Can you see any advantage of the digital scheme (requring 8 pins) over the analog scheme requiring 1 pin?
To be honest, it really has to do with the OP knowledge and if he is able to understand how to convert his keypad to use an analog pin. If he is unable to do so, then its better to use the standard digital method, or the method you pointed out with the 74hc922 chip.
It is quite a hassle to convert a standard keypad to a analog keypad, if you don't know what you're doing.
But now he has options to go about and solve his problem.
raschemmel:
If I understand correctly, he only needs eight pins if he uses the digital decoding scheme because as already pointed out, he only needs one analog pin for everything if he uses the analog scheme. Can you see any advantage of the digital scheme (requring 8 pins) over the analog scheme requiring 1 pin?
Of course!
- You need only a keypad, and not a bunch of resistors
- You don't need the electronic skills to wire up resistors
- There is a very nice library for using a keypad.
All I did was connect the keypad to 8 ports on my arduino, use the keypad.h library, map my keys and it worked. If anyone wants to look at the wiring and the code please let me know
.
Also, thank you everyone your comments did help me A lot
insanehadi:
All I did was connect the keypad to 8 ports on my arduino, use the keypad.h library, map my keys and it worked. If anyone wants to look at the wiring and the code please let me know.
Also, thank you everyone your comments did help me A lot
Thanks for geting back to us and letting us know.