Cape Town South Africa
Offline
Edison Member
Karma: 17
Posts: 1104
A newbie with loads of posts, and still so much to learn !
|
 |
« on: October 03, 2010, 12:43:37 pm » |
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
|
We live in the era of the smart phones and stupid people.
|
|
|
|
Central Europe
Offline
Edison Member
Karma: 5
Posts: 1220
Use the Source, Luke.
|
 |
« Reply #1 on: October 03, 2010, 01:49:41 pm » |
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
Edison Member
Karma: 17
Posts: 1104
A newbie with loads of posts, and still so much to learn !
|
 |
« Reply #2 on: October 03, 2010, 01:57:30 pm » |
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
|
We live in the era of the smart phones and stupid people.
|
|
|
|
Central Europe
Offline
Edison Member
Karma: 5
Posts: 1220
Use the Source, Luke.
|
 |
« Reply #3 on: October 03, 2010, 02:18:21 pm » |
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
Edison Member
Karma: 17
Posts: 1104
A newbie with loads of posts, and still so much to learn !
|
 |
« Reply #4 on: October 03, 2010, 04:04:42 pm » |
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
|
We live in the era of the smart phones and stupid people.
|
|
|
|
Cape Town South Africa
Offline
Edison Member
Karma: 17
Posts: 1104
A newbie with loads of posts, and still so much to learn !
|
 |
« Reply #5 on: October 03, 2010, 09:53:23 pm » |
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
|
We live in the era of the smart phones and stupid people.
|
|
|
|
Seattle, WA USA
Offline
Brattain Member
Karma: 316
Posts: 35566
Seattle, WA USA
|
 |
« Reply #6 on: October 04, 2010, 05:40:03 am » |
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
Edison Member
Karma: 17
Posts: 1104
A newbie with loads of posts, and still so much to learn !
|
 |
« Reply #7 on: October 04, 2010, 09:59:50 am » |
Thanks, that's what I will try tonight, I bought a lcd display today and will see what happens with the cursor
|
|
|
|
|
Logged
|
We live in the era of the smart phones and stupid people.
|
|
|
|
Central Europe
Offline
Edison Member
Karma: 5
Posts: 1220
Use the Source, Luke.
|
 |
« Reply #8 on: October 04, 2010, 10:03:45 am » |
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
|
|
|
|
|
|