For my next project I want to send text messages via wireless link, to show on a led display.
I have used a 4x4 matrix keypad for my last project, and I was thinking of using the same keypad, with a printed vinyl overlay similar to a normal celphone.
I am not worried about numbers for now, if I can get the text working. I did a search for a similar arduino project with no luck, does anyone know of one?
Otherwise I have a couple of ideas for the timing for the key presses.
If you wanted to store say the letter "b" you would press the key 2 twice within a second.
So if key 2 is pressed, we wait a second to see if it is pressed again, ( if not we pass an "a" to the message string ) but what happens if the key is held pressed for a second?
Usually:
Press a key under 2s --> First letter of the group is displayed.
Press the same key again inside 2 or 3 s --> letter is exchanged by next one in the group.
Press another key --> New letter is added
Press key for 2s or more --> On press the first letter of the group is displayed, after 2 s it's replaced by the digit on the key.
Visually, as long as the cursor is on the same letter, pressing the key again will change it, after the time-out, the cursor advances to the empty space to the right.
Yes thats what I want to do but with my cheap 4x4 keypad, connected to the arduino and using the keypad library.
I have just hooked up a basic keypad sketch, now I must figure out the timing. I have used delay several times, but this seems to need a "during" or something function.....
No, what's needed for you is to get rid of the library and code the function you need. Libraries are nice only as long as they do what you need. If not, just steal from them what you need.
If you check millis() after each keystroke, the system will be much more responsive. If the key is the same, and the difference in time between two key presses is small enough, advance the letter. If the key is different, accept the previous letter, and initialize for this letter.