writing and reading to the eeprom

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
Ondra
Posts: 325
Joined: Wed Aug 29, 2007 7:33 pm
Been thanked: 2 times
Contact:

writing and reading to the eeprom

Post 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)

Ondra
Posts: 325
Joined: Wed Aug 29, 2007 7:33 pm
Been thanked: 2 times
Contact:

Re: writing and reading to the eeprom

Post by Ondra »

Good day all. Some help on this would be appreciated. Thanks in advance.

Ondra

User avatar
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

Post 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.

Post Reply