I have a very odd issue. I have a very small test program below that works fine. When I copy and paste the code into my much larger application and then compile I get EEPROM not declared in this scope. I have made sure that I have the same #include as below pasted in. Any ideas?
#include "spark_wiring_eeprom.h"
int loops = 0;
char line[80];
void setup()
{
Serial.begin(9600);
delay(25000);
Serial.println("start");
}
void eepromWriteString(char* buffer)
{
int i = -1;
do
{
i++;
EEPROM.write(i,buffer[i]);
} while (buffer[i] != 0);
}
char* eepromReadString()
{
char buffer[100];
int i = -1;
do {
i++;
buffer[i] = (char) EEPROM.read(i);
} while (buffer[i] != 0);
return(buffer);
}
void loop()
{
char data[20];
sprintf(data,"test %d",loops);
eepromWriteString(data);
delay(1000);
strcpy(data,eepromReadString());
Serial.print("read = ");
Serial.println(data);
delay(10000);
loops++;
}