The count variable is incremented here before the assignment to the array. This means the index values used will be 1 to 512 rather than 0 to 511. The last value of 512 will write beyond the end of the 512 byte array potentially trampling on other things.
|
if (count < LENGTH) { |
|
count++; |
|
rawData[count] = analogRead(A0)>>2; |
|
} |
The
countvariable is incremented here before the assignment to the array. This means the index values used will be 1 to 512 rather than 0 to 511. The last value of 512 will write beyond the end of the 512 byte array potentially trampling on other things.Arduino-Guitar-Tuner/Tuner_aRead.ino
Lines 28 to 31 in 12a9be9