Retreiving data from flash after boot
the http://www.arduino.cc/en/reference/progmem has clear example of how save , load int value in flash memory.
but reading data makes use of variable charset (initiliased when writing it) address:
how can read data without knowing address?
for example (hypothetical case)
this give errors because charset not known @ first call
but reading data makes use of variable charset (initiliased when writing it) address:
code: [select]
progmem prog_uint16_t charset[] = {65000};
unsigned int displayint;
int k; // counter variable
// read 2-byte int
displayint = pgm_read_word_near(charset + k)how can read data without knowing address?
for example (hypothetical case)
code: [select]
unsigned int displayint;
// read 2-byte int
displayint = pgm_read_word_near(charset + 0)
if (digitalread(button) == 1){
value = displayint + 1; //some value based upon value retrieved flash
progmem prog_uint16_t charset[] = {value};
}
this give errors because charset not known @ first call
Arduino Forum > Using Arduino > Programming Questions > Retreiving data from flash after boot
arduino
Comments
Post a Comment