I'm attempting to reduce the amount of RAM being used by my program by writing some values to the EEPROM of my micro controller. I'm currently programming on the ATtiny85 which has 512 Bytes of EEPROM. According to the documentation this is how you write to EEPROM:
#include <EEPROM.h>
void setup() {
EEPROM.write(0, 1);
EEPROM.write(1, 0);
EEPROM.write(2, 3);
EEPROM.write(3, 2);
EEPROM.write(4, 1);
}
For some reason this isn't working for me and I can't seem to find the error. Am I programming this wrong or can the EEPROM of the ATtiny simply NOT be accessed with Arduino Code?
Here is the Datasheet: http://www.atmel.com/Images/Atmel-2586-AVR-8-bit-Microcontroller-ATtiny25-ATtiny45-ATtiny85_Datasheet-Summary.pdf
Here is the second sketch I'm using to test the EEPROM:
#include <EEPROM.h>
bytevoid CLKsetup() ={
EEPROM.readwrite(0, 1);
EEPROM.write(1, 0);
void setup EEPROM.write()2, {A3);
EEPROM.write(3, A2);
pinMode EEPROM.write(CLK4, OUTPUTA1);
byte CLK = EEPROM.read(0);
}
void loop() {
if(CLK == 1)
{
for(int i = 0; i < 3; i++)
{
digitalWrite(0, HIGH);
delay(1000);
digitalWrite(0, LOW);
delay(1000);
}
exit(0);
}
else
{
for(int i = 0; i < 100; i++)
{
digitalWrite(0, HIGH);
delay(1000);
digitalWrite(0, LOW);
delay(1000);
}
exit(0);
}
exit(0);
}