Just noticed something...
The script is set up to use the EEPROM... but there's no "erase eeprom" function at the beginning of the script.. before writing to the eeprom. The eeprom's still holding values from the last time it was flashed/programmed. I'm playing with the original script.. not my modified version.. if I change values in the LED variables, it still loads whatever values were in the script the last time. I've verified this.. 3 times.
Since we have the EEPROM library installed.. open the "eeprom_clear" example.. flash that before loading a newly revised script/sketch.. new values are now in control.
The script is set up to use the EEPROM... but there's no "erase eeprom" function at the beginning of the script.. before writing to the eeprom. The eeprom's still holding values from the last time it was flashed/programmed. I'm playing with the original script.. not my modified version.. if I change values in the LED variables, it still loads whatever values were in the script the last time. I've verified this.. 3 times.
Since we have the EEPROM library installed.. open the "eeprom_clear" example.. flash that before loading a newly revised script/sketch.. new values are now in control.
Code:
/*
* EEPROM Clear
*
* Sets all of the bytes of the EEPROM to 0.
* This example code is in the public domain.
*/
#include "EEPROM.h"
void setup()
{
// write a 0 to all 512 bytes of the EEPROM
for (int i = 0; i < 512; i++)
EEPROM.write(i, 0);
// turn the LED on when we're done
digitalWrite(13, HIGH);
}
void loop()
{
}