int layer1[25]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
EEPROM.write(layer1[currentled], 1);
i am working with loops, can i write to eeprom like this?
int layer1[25]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
EEPROM.write(layer1[currentled], 1);
i am working with loops, can i write to eeprom like this?
Sure.
zedpython:
int layer1[25]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
EEPROM.write(layer1[currentled], 1);
i am working with loops, can i write to eeprom like this?
You can do that if you want. It will write a 1 to the EEPROM at the address in layer1[currentled]. Is that what you want to do ?
If your questions is whether you can use variables as the address or value to be written then the answer is yes to both.
From https://www.arduino.cc/en/Reference/EEPROMWrite:
An EEPROM write takes 3.3 ms to complete. The EEPROM memory has a specified life of 100,000 write/erase cycles, so you may need to be careful about how often you write to it.
You can also extend the life of your EEPROM by using EEPROM.update() instead of EEPROM.write(). EEPROM.update() only writes to EEPROM if the value has changed. EEPROM.put() has the same behavior as EEPROM.update().