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

Discussion in 'General Electronics Chat' started by kirayamato_143, Jan 17, 2012.

  1. kirayamato_143

    Thread Starter Member

    Jan 23, 2011
    59
    0
    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
     
  2. joeyd999

    AAC Fanatic!

    Jun 6, 2011
    2,690
    2,755
    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.
     
  3. kirayamato_143

    Thread Starter Member

    Jan 23, 2011
    59
    0
    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
     
  4. joeyd999

    AAC Fanatic!

    Jun 6, 2011
    2,690
    2,755
    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.
     
  5. kirayamato_143

    Thread Starter Member

    Jan 23, 2011
    59
    0
    i wish someone have time to do so..please..anyone
     
  6. kirayamato_143

    Thread Starter Member

    Jan 23, 2011
    59
    0
    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: Jan 20, 2012
Loading...