I set out to see how much space some arrays have. I used this test code
bool state = false;
uint16_t BuffA[46000];
uint16_t BuffB[20000];
uint16_t BuffC[20000];
uint16_t all = 0;
void setup(){
Serial.begin(9600);
}
void loop(){
if (state==false){
Serial.println(sizeof(BuffA));
Serial.println(sizeof(BuffB));
Serial.println(sizeof(BuffC));
all = sizeof(BuffA) + sizeof(BuffB) + sizeof(BuffC)
Serial.println(all);
state = true;
}
}
I got this answer from the serial:
92000
40000
40000
40928
- Why are the results doubled from those i initiated? Shouldn't the first one be 46kb and the other two 20kb?
- Why is the last value only 40928?
- The RAM of Due is 96kb. Does this mean that with the initialization of only three arrays it's almost full? Ifi crossed the RAM limit, would the IDE throw an error?
- If i still need more RAM, can i use and external one with Due for high speed RAM acquisition?