Go Down

Topic: text input like a celphone ( multi pressing keys) (Read 848 times) previous topic - next topic

Boffin1

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?


With my mobile phone I can call people and talk to them -  how smart can you get ?

Korman

#1
Oct 03, 2010, 08:49 pm Last Edit: Oct 03, 2010, 08:50 pm by Korman Reason: 1
Take your mobile and try it out.

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.

Korman

Boffin1

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.....
With my mobile phone I can call people and talk to them -  how smart can you get ?

Korman

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.

Korman

Boffin1

I am using the keypad library as I have it working fine, I am now trying to master the millis function for this project
With my mobile phone I can call people and talk to them -  how smart can you get ?

Boffin1

Can I monitor elapsed time by setting "timewindow" with the first key input, and then counting how many of the same key presses within 2 seconds with

while (( millis - timewindow )<= 2000 ) { whatever ;} ,

or do I have to check millis with each keystroke.
With my mobile phone I can call people and talk to them -  how smart can you get ?

PaulS

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.

Boffin1

Thanks, that's what I will try tonight, I bought a lcd display today and will see what happens with the cursor

With my mobile phone I can call people and talk to them -  how smart can you get ?

Korman

#8
Oct 04, 2010, 05:03 pm Last Edit: Oct 04, 2010, 05:04 pm by Korman Reason: 1
Quote
I bought a lcd display today and will see what happens with the cursor


That should read: what you do with the cursor.

In programming, things that happen are always bad. You always should do instead of letting things happen.

Korman

Go Up