Shop OBEX P1 Docs P2 Docs Learn Events
help!! how to write data to EEPROM? — Parallax Forums

help!! how to write data to EEPROM?

danlodanlo Posts: 5
edited 2007-01-26 14:58 in BASIC Stamp
I want input a number (e.g 123) by using 4x4 keypad, and then, store it into EEPROM and display it to LCD..

'VAR
number···· VAR···· word

'Data
store_num ·DATA··· 120

Main:
........··········· ' code to get number, number = 123
write 120, number
.......

What wrong of my programe?·Would you·give me an example? ...thank you so much!!
·

Comments

  • stamptrolstamptrol Posts: 1,731
    edited 2007-01-26 12:45
    What you are doing in the Main: is storing the value of 'number' in EEPROM location 120. Is that what you want?

    The examples in the Help file cover the use of this instruction quite well.

    If you have more questions, posting the working part of your program would help everyone understand your problem a bit better.

    Cheers,

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tom Sisk

    http://www.siskconsult.com
    ·
  • TechnoRobboTechnoRobbo Posts: 323
    edited 2007-01-26 14:58
    danlo said...
    store_num DATA 120

    If you're trying to store at address 120 you should write it like this

    store_num DATA @120,0

    the @ defines the address, the 0 is a dummy data

    otherwise store_num's address is determined by the compiler.

    if you don't use @ the label "store_num" represent the address, so you might as well use it:

    write store_num,number

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Have Fun


    TR

    Post Edited (TechnoRobbo) : 1/26/2007 7:40:52 PM GMT
Sign In or Register to comment.