uint8_t eeprom_read_byte ( const uint8_t * __p ) Read one byte from EEPROM address __p.
int adress = 0;//I want position 0int readValue = eeprom_read_byte(&i);//It wount work as expected don´t understand whyint readValue = eeprom_read_byte((uint8_t *)i);//Doing a cast work's well but why ?
uint8_t adress = 0;//I want position 0uint8_t readValue = eeprom_read_byte(&adress);//It wount work as expected don´t understand whyuint8_t readValue = eeprom_read_byte((uint8_t *)adress);//Doing a cast work's well but why ?
With the ampersand you are giving it the address of the variable adress and that isn't 0.
But the function expect an address!!
But not the address of the variable that holds the address
QuoteBut not the address of the variable that holds the addressUhmm I was thinking that passing the address of the variable was in fact making the functions "looks" to the value 0 which was the eeprom address I want.Perhaps you are right, time to move on and just use the cast.
Please enter a valid email to subscribe
We need to confirm your email address.
To complete the subscription, please click the link in the
email we just sent you.
Thank you for subscribing!
via Egeo 16