Before I posted this question (a really basic one, I am absolutely sure), I read this:http://arduino.cc/de/Reference/Array
The difference from what I want to do is the initialization of the array. I want to give values to the array inside a cycle, and the example shows an array being read in a cycle. What I tried to do, just to try and put the concept to work in the simplest way possible (and I can't understand why it doesn't work), was this:
val = 1;
val = 5;
val = 2;
val = 10;
Serial.print("val0 = ");
Serial.print("val1 = ");
Serial.print("val2 = ");
Serial.print("val5 = ");
The code compiles but nothing is printed. If I comment all the array related lines then I can see val0 = val1 = val2 = val5 = val0... as expected.
Is there limitation to filling arrays at different zones of the arduino code?
Thanks in advance, I hope the details are enough.