PaulS:
From what library/file?
c:\users<myusername>\appdata\local\arduino15\packages\arduino\tools\avr-gcc\5.4.0-atmel3.6.1-arduino2\avr\include\avr\eeprom.h
PaulS:
From what library/file?
c:\users<myusername>\appdata\local\arduino15\packages\arduino\tools\avr-gcc\5.4.0-atmel3.6.1-arduino2\avr\include\avr\eeprom.h
That's not where the file is on my system, but I found it. It is certainly bizarre that the function takes a pointer to an address, rather than an address.
The read() method in the EEPROM class simply casts the int value to a const char * when calling that function.
PaulS:
That's not where the file is on my system, but I found it. It is certainly bizarre that the function takes a pointer to an address, rather than an address.The read() method in the EEPROM class simply casts the int value to a const char * when calling that function.
I started with EEPROM.h, the arduino standard library, but moved to the GCC library at the suggestion of DKWatson, as it was discovered that EEPROM.h is flawed.
So, I did some googling and found a Tutorial on the GCC library written by Dean Camera. From this tutorial, I learned 2 things. 1) typecasting my constant integers as byte pointers
byte lastValueSecondsOnes = eeprom_read_byte((byte *) 0);
and using the function
eeprom_update_byte ((byte *) 0, lastValueSecondsOnes);
to replace my if read then write argument. It compiles without a warning (I know it's suppressed) and my code is working.