i have this 12 matrix phone keypad and some 4511 CMOS as 7 segment driver.
what i try to achieve is to dial a digit, then another one, then a third one etc and as soon as i hit the # button the 7 segments come up according to the digits i have dialed. the idea is to do it this way:
7segment #1 (pin 2,3,4,5)
dial a digit,
convert it to a 4digit binary,
store it to memory
move to ->
7segment #2 (pin 6,7,8,9)
dial a digit,
convert it to a 4digit binary,
store it to memory
move to ->
etc...
and realease the whole thing with the #button.
any sugestions how i could do that? maybe with the GOTO command? (move to next 7 segment after binary is stored in memory)
how do i push data into a temporary memory and call it later?
Start off with matrix Keypad.h library, show tha you can read the keys and send to the IDE's serial monitor, add from there to send to your intended display.
If if the digits entered will be the same qty every time, you can stuff them into an array as you read them.
i already have done that. the keypad is not an issue. it works fine.
i am more intrested how to "store" the digits, call them and then delete the memory.
i maybe should use the bitWrite, bitRead, bitClear functions?
// go read the keypad
char key = keypad.getKey(); // reading the keypad
if(key) // same as if(key != NO_KEY)- did something change?
Then add some stuff like this, using x to keep track of which digit you are expecting.
{
if ( key != '#' ){
msg [ x ] = key; // load the array with the key character
else ( entry_done_flag = 1;
}