EEPROM(WRITE,...)
Description
Writes data to non-volatile memory.
Syntax
EEPROM(WRITE, memory_num, data);
Parameters
Variable | Input |
|---|---|
| Any number from 1 to 254. |
| Any signed 32-bit number. |
Returns
Return value | Return explanation |
SCRIPT_OPERATION_SUCCESS | Successful EEPROM write operation. |
SCRIPT_OPERATION_FAILED | Failed to write to EEPROM. |
SCRIPT_PARAM_INVALID | Invalid |
Function call example
Example of writing EEPROM
main(){
while(1){
EEPROM(WRITE, 3, 238); // write number 238 to eeprom memory address number 3
Delay(100);
}
}Notes and Warnings
Keep in mind, if data is saved more than once at the same memory address place (same memoryNum), previously written data will be erased and new information will be stored.
Example:
Example of overwriting EEPROM
main(){
while(1){
EEPROM(WRITE, 3, 238); // write number 238 to eeprom memory address number 3
EEPROM(WRITE, 3, 5464); // write over old data (number 238) into new data (number 5464)
Delay(100);
}
}