Skip to content

Commit 65f3b28

Browse files
committed
CurieEEPROM eeprom_write example
-increment eeprom address at the correct location so it matches the read example
1 parent 6885cde commit 65f3b28

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libraries/CurieEEPROM/examples/eeprom_write/eeprom_write.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ void setup() {
2222
for(int i = 0; i < EEPROM.length()/8; i++)
2323
{
2424
unsigned long val = analogRead(0);
25-
addr +=4; //increment address by 4 since we are using DWORDs
2625
Serial.print("Addr:\t");
2726
Serial.print(addr);
2827
Serial.print("\tWriting: ");
2928
Serial.println(val);
3029
EEPROM.write(addr, val);
30+
addr +=4; //increment address by 4 since we are using DWORDs
3131
delay(100);
3232
}
3333

@@ -36,12 +36,12 @@ void setup() {
3636
for(int i = EEPROM.length()/2; i < EEPROM.length(); i++)
3737
{
3838
byte val8 = analogRead(0)/4;
39-
addr++;
4039
Serial.print("Addr:\t");
4140
Serial.print(addr);
4241
Serial.print("\tWriting: ");
4342
Serial.println(val8);
4443
EEPROM.write(addr, val8);
44+
addr++;
4545
delay(100);
4646
}
4747

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy