That makes sense. I will try the enhanced IDE.
I can create multiple long arrays of size 1000 but I have not tried to fill them up. That's probably why they seem fine to me.
Here's my code:
void loop() {
long t1[1000]; //type long to store big numbers (time in ms)
long t2[1000];
long t3[1000];
int n[2000];
// if there's any serial available, read it:
if (Serial.available() > 0) {
if(start == 0){
// look for the next valid integer in the incoming serial stream:
long c1 = Serial.parseInt();
// do it again:
int c2 = Serial.parseInt();
// look for newline
if (Serial.read() == '\n') {
Serial.println(c1, DEC);
Serial.println(c2, DEC);
t1[index] = c1;
n[index] = c2;
++index;
}
}
else if(start == 1){
//output to pins
int i;
for (i = 1; i < index; i=i+1){
delay(t1[i]-t1[i-1]);
digitalWrite(n[i-1]*2+20, LOW);
digitalWrite(n[i]*2+20, HIGH);
}
}
//print what's currently in the arrays
Serial.println("Sequence");
int i;
for (i = 0; i < index; i = i + 1) {
Serial.println(t1[i]);
//Serial.println(n[i]);
}
}
}