Hello,
I was just testing out the feature/hal branch with EEPROM writing/reading but it seems there is something wrong there… I always get the last written value back when I try to read out a specific address from the EEPROM. I tested my code on the master branch and it works perfectly… Any ideas?
#include "application.h"
SYSTEM_MODE(AUTOMATIC);
void setup()
{
uint8_t val1 = 45;
uint8_t val2 = 40;
// Initiate serial communication
Serial.begin(9600);
while(!Serial.available()) // Wait here until the user presses ENTER
SPARK_WLAN_Loop(); // in the Serial Terminal. Call the BG Tasks
Serial.println("SETUP");
Serial.println("EEPROM.read: ");
Serial.println(EEPROM.read(0));
Serial.println(EEPROM.read(10));
Serial.println("EEPROM.write: ");
EEPROM.write(0, val1);
EEPROM.write(10, val2);
}
void loop()
{
Serial.println("LOOP");
Serial.println("EEPROM.read: ");
Serial.println(EEPROM.read(0));
Serial.println(EEPROM.read(10));
delay(5000);
}