Pages: [1]   Go Down
Author Topic: text input like a celphone ( multi pressing keys)  (Read 687 times)
0 Members and 1 Guest are viewing this topic.
Cape Town South Africa
Offline Offline
Edison Member
*
Karma: 19
Posts: 1217
A newbie with loads of posts, and still so much to learn !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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?


Logged

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

Central Europe
Offline Offline
Edison Member
*
Karma: 7
Posts: 1220
Use the Source, Luke.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
« Last Edit: October 03, 2010, 01:50:27 pm by Korman » Logged

Cape Town South Africa
Offline Offline
Edison Member
*
Karma: 19
Posts: 1217
A newbie with loads of posts, and still so much to learn !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.....
Logged

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

Central Europe
Offline Offline
Edison Member
*
Karma: 7
Posts: 1220
Use the Source, Luke.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Cape Town South Africa
Offline Offline
Edison Member
*
Karma: 19
Posts: 1217
A newbie with loads of posts, and still so much to learn !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I am using the keypad library as I have it working fine, I am now trying to master the millis function for this project
Logged

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

Cape Town South Africa
Offline Offline
Edison Member
*
Karma: 19
Posts: 1217
A newbie with loads of posts, and still so much to learn !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

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

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Cape Town South Africa
Offline Offline
Edison Member
*
Karma: 19
Posts: 1217
A newbie with loads of posts, and still so much to learn !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Logged

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

Central Europe
Offline Offline
Edison Member
*
Karma: 7
Posts: 1220
Use the Source, Luke.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
« Last Edit: October 04, 2010, 10:04:28 am by Korman » Logged

Pages: [1]   Go Up
Jump to: