I can't seem to index an array using the index of a for loop.
The following code works fine, printing "65" to the serial:
void setup()
{
Serial.begin(9600);
}
void loop()
{
int test[480];
for(int i=0; i<480; i++)
{
for(int j=0; j<57; j++)
{
test[479] = 65; // line 13
}
}
Serial.println(test[479]);
}
however if I change line 13 to test[i] = 65;
I no longer get anything on Serial.
what could be wrong?
EDIT: Nevermind. It appears to be working fine now, at least in my test case. Not too sure what was wrong before. I'll leave this up just in case there really is something about this...