Menu

Help with Array and Data String storage into EEProm

Help
Keith
2020-12-07
2020-12-07
  • Keith

    Keith - 2020-12-07

    Can anyone point me in the general direction of some example code on working with Arrays and data storage. I have been over the help files and demo programs like a nasty rash and ended up more confused than when I started.
    I gather I need to establish an array with a statement like 'DIM array_DateStamp ( 20 ) which will setup an Array called DateStamp of 20 Lines. in the RAM

    How would I create the Array in EEProm and what about the string length....

    (My Head Hurts! )

     
  • kent_twt4

    kent_twt4 - 2020-12-07

    I don't think I would use strings here as Dec will suffice. Please substitute GCB I2C routines for my I2CWrites. If DS1307 then use BCD to Dec routine before storing. Something like this:

    sub WriteRTCeeprom
    I2CWrite(write_HK24C32,addr1,Mth)
    wait 6 ms
    addr1 += 1
    I2CWrite(write_HK24C32,addr1,Dte)
    wait 6 ms
    addr1 += 1
    I2CWrite(write_HK24C32,addr1,Yr)
    wait 6 ms
    addr1 += 1
    I2CWrite(write_HK24C32,addr1,Hr)
    wait 6 ms
    addr1 += 1
    I2CWrite(write_HK24C32,addr1,Min)
    wait 6 ms
    addr1 += 1
    I2CWrite(write_HK24C32,addr1,Secs)
    wait 6 ms
    addr1 += 1
    end sub

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.