7 segments display using 3X4 Keypad
rania
Posts: 12
in BASIC Stamp
I need some help with my project. I'm planning to use a 3x4 keypad and a display with 2 7segments. The plan is to display in the 7segments the number what is press in the keypad.
i am using COM-08653 keypad ... my columns are connected to P0,P1,P2... my rows are connected to P3,P4,P5,P6.
attached is the connection layout
Thanks
i am using COM-08653 keypad ... my columns are connected to P0,P1,P2... my rows are connected to P3,P4,P5,P6.
attached is the connection layout
Thanks
Comments
You have pull-downs on the columns, so that means you will want to make each of the rows high (1 at a time) and see if any of the columns go high. If any of them do, then the key that connects the row (that you made high) and the column (that you read as high) must be pressed.
So basically you will make P0 high and P1 & P2 inputs (don't make them LOW because if more than one key is pressed you could get a short). Then read the P3 thru P6 pins to see if any are high.
Then make P1 high and P0 & P2 inputs, and read pins P3 thru P6 again, and so on...
I hope that makes sense. Please let us know if this is helpful.
Bean
I'm afraid this code really won't work with the keypad rania has. It is intended for a keypad with series resistors, not resistors to ground (also it is 4x4 not 4x3 and wired differently). Bean explained exactly what rania has to do; he simply needs to translate it to BS2 code.
Edit: Actually, I think Bean got it wrong, too. His detailed description has rania driving the columns and sensing the rows. He should drive the rows (P3..7) and sense the columns (p0..2). This is because the pulldowns are on the columns.
Many thanks for all of you ...
' ay to do it.
many thanks
2. Program the Microcontroller to do the following:
a. The green LED will turn ON, show letter “r” on the display
b. Wait until * key is pressed and released. Nothing should happen if any key is held pressed.
c. When * key is released, the green LED will turn off and red LED will turn on, letter “t” will be shown on the display, and the Microcontroller will wait until any numeric key between “1 and 9” is pressed and released.
d. When any numeric key between “1 and 9” is released, the Microcontroller will wait until “#” key is pressed and released.
e. When “#” key is released, the Microcontroller will count down starting from the number pressed to “0”. Each count will be displayed for 1 second.
f. When Microcontroller finishes counting down, the program will start over again waiting for the user to press * key with the green LED turned on and red LED off.
I am trying to execute actions when a key is pressed then released not while still pressed. i tried to save old status (pressed) and new one (released) but it did not work ..i tried to use the release sub routine in the code above yet i couldn't get it to function as intended
Released:
oldKey = 100
LOW 7
OUTH = %11110000
HIGH 8
however this will apply the changes whenever a key is released while i need the changes to apply only if * key is released
Then you will need to test (presumably inside the release subroutine) whether the key that was released is the * key.