Page 1 of 1

writing and reading to the eeprom

Posted: Mon Jul 19, 2010 11:10 am
by Ondra
Good day all. With eeprom writing and reading what is the rule when writing bytes to a location, then reading those bytes into a string var. I am trying to calculate some values up to 9 then storing the byte results in eeprom locations. I then tried to index the value into a string and print the results to an LCD Screen. The label in quotes prints but the values don't. i.e

// Calculating byte values and writing to the eeprom
digit_1 = eeprom(0)::Read[idx] // first I read the value that is stored in the location. Note Location is initialized with a 0 value.
If (digit_1 < 9) {
digit_1 = digit_1+1
eeprom(0)::Write(11, digit_1)
}


//Reading from the eeprom and writing to the string var
idx = 11
idx_2 = 0

loop count 9 { // there are up to a total of 9 digits

string var [idx-2]= eeprom(0)::Read[idx]

idx = idx + 1
idx_2 = idx_2 + 1
}
string var[idx_2] = 0
Macro.Return = string var
Command = string var

//Printing to the LCD screen

Command = "label" + Command
LCDDisplay(0)::Cursor(0,1)
LCDDisplay(0)::PringString(Command)

Re: writing and reading to the eeprom

Posted: Tue Jul 20, 2010 10:55 am
by Ondra
Good day all. Some help on this would be appreciated. Thanks in advance.

Ondra

Re: writing and reading to the eeprom

Posted: Tue Jul 20, 2010 4:27 pm
by Benj
Hello Ondra,

Do you have a Flowcode program you can post up? This would save me a lot of time creating you an example if 99% of the code is already there.

No real rules when it comes to reading and writing. Other then the fact that you can only overwrite the locations a fixed number of times. I think this is around 10,000 re-writes.