I have a globally declared array called:
int dataArray[8];
in the setup() section I initialise all 8 elements of the array like this:
dataArray[0] = 0x01;
dataArray[1] = 0x02;
dataArray[2] = 0x04;
dataArray[3] = 0x08;
dataArray[4] = 0x10;
dataArray[5] = 0x20;
dataArray[6] = 0x40;
dataArray[7] = 0x80;
In no other part of my program do I assign new values, I only read from the array.
The problem is that when I read the array it gives me wrong numbers, but only for the first three elements!
These are the values I get
dataArray[0] = 8192
dataArray[1] = 16384
dataArray[2] = -32768
dataArray[3] = 8 (correct value)
dataArray[4] = 16 (correct value)
dataArray[7] = 128 (correct value)
Can anyone tell me what is wrong???