Hi, all
I try to store Unsigned Long data with ProgMem.
The follwoing looks good:
#include <avr/pgmspace.h>
unsigned long mydata[] PROGMEM =
{
0,
1,
2,
3,
4,
5,
6,
7,
8,
9
};
unsigned long byte1;
void setup()
{
Serial.begin(9600);
Serial.println("Setup Done");
}
void loop()
{
for(int i=0;i<10;i++)
Serial.println(pgm_read_byte(&mydata[i]));
Serial.print("--------");
for( ; ; ) ;
}
The result show: 0,1,2,3,4,5,6,7,8,9
But if I replace with bigger numbers, it goes wrong:
unsigned long mydata[] PROGMEM =
{
0,
11111,
2,
3,
4,
5,
6,
7,
8,
9
};
The result show: 0,103,2,3,4,5,6,7,8,9
Is there any better way to deal with bigger numbers??
Thank you.