[help]input a number to lcd using button w/ cursor using 16f628a

Thread Starter

kirayamato_143

Joined Jan 23, 2011
59
hi everyone this is for the password of my timer im making. Please help me by providing a simple program, the lcd should receive input from a button which will increment from 0 to 9 and another button that move the cursor to the right, i cant find resources to do this in lcd, im using mikroC please help me thank you
 

joeyd999

Joined Jun 6, 2011
5,237
hi everyone this is for the password of my timer im making. Please help me by providing a simple program, the lcd should receive input from a button which will increment from 0 to 9 and another button that move the cursor to the right, i cant find resources to do this in lcd, im using mikroC please help me thank you
The LCD doesn't receive push button inputs, the CPU does.

You need at least 3 routines:

1. A routine to capture push button inputs
2. A routine to 'sanitize' the inputs and accept the data into a buffer (most likely, a state machine), and set a flag to indicate 'new data' is available.
3. A routine to 'print' the buffer (and any related text) onto the LCD.

Don't rely on the LCD to remember the state of the cursor and previous text output. It can, but this will give you limited future functionality. Refresh the display each time you want to update it, and only update it when new data is available.
 

Thread Starter

kirayamato_143

Joined Jan 23, 2011
59
can you provide me a sample program as simple as it shows a cursor then a press a button to input 1 write it to eeprom and save it to eeprom and display it to lcd
 

joeyd999

Joined Jun 6, 2011
5,237
Someone else here might. Sorry, I am currently swamped with work, and cannot quickly put anything together for you. Besides, I write asm, not C for embedded processor apps.
 

Thread Starter

kirayamato_143

Joined Jan 23, 2011
59
i'm able to do the program now using eeprom but my problem is i dont know how to logically implement my change password, ..
my problem is i cant intialize the value of eeprom adress 0 to a number that should not be pre declared in the introduction of my program so when it restart it never returned the pre declared value but instead read my stored value...
 
Last edited:
Top