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)
writing and reading to the eeprom
Moderator: Benj
Re: writing and reading to the eeprom
Good day all. Some help on this would be appreciated. Thanks in advance.
Ondra
Ondra
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: writing and reading to the eeprom
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel