rotary encoder + hit button = keyboard

excuse me guys. i have this idea, i want to store a cellphone number in an eeprom. i'm planning to use only a rotary encoder, a push button and an lcd screen. every number of the cellphone will be chosen via knob from 0 to 9. every digit selected will be incremented by hitting the push button. after completing all the digits, the arduino will save the cellphone number to the eeprom. is this possible? if yes, do you guys have a parallel snippets or code for this? any suggestion will be also helpful.. thanks a lot.more power to arduino..

after completing all the digits,

How is this condition decided?

sorry sir awol if i misinterpret your reply, english is not my first language.

if the 11digit cellphone number is already completed sir.. the the next press of the button will save to the eeprom. then later on i will read the data to apply in my gsm module.

The above has my rotary encoder code to tell you if the encoder has gone "up" or "down" a "click". Using this code, you can decide what to do when an "up" is sensed. If you also want to try my buttons library, its most recent unofficial update includes capability to incorporate rotary encoders as two buttons (up and down). Then you can make a third button a regular button to sense the rotary encoder is pressed.

phi_buttons library download:

http://code.google.com/p/phi-prompt-user-interface-library/downloads/detail?name=phi_buttons 323 software button mod.zip

If you need sample code, I might be able to dig up the code I used.

Meanwhile, this may be useful to you:

With the library, you can set a preset length of input to be 11 and restrict the input characters between '0' and '9' for your purpose.

wow! thanks a lot sir liudr!! this will be a very good help.. Godbless! :smiley:

You are welcome. I'll make a sample program for you once I have some time. You can dissect it to make your own code or just use mine. All my codes are libraries are open source.