int T = 50; | int T = 50; |
---|---|
int p[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}; | // |
void setup(){ | void setup(){ |
Serial.begin(9600); | Serial.begin(9600); |
for(int i=0; i<14; i++){ | for(int i=0; i<14; i++){ |
pinMode(p[i],OUTPUT); | pinMode(i, OUTPUT); |
Serial.print(set: ); | Serial.print(set: ); |
Serial.println(p[i]); | Serial.println(i); |
delay(T); | delay(T); |
} | } |
} | } |
void loop(){ | void loop(){ |
Serial.print(marker ); | Serial.print(marker ); |
for(int i=0; i<14; i++){ | for(int i=0; i<14; i++){ |
digitalWrite(p[i], HIGH); | digitalWrite(i, HIGH); |
Serial.print(up: ); | Serial.print(up: ); |
Serial.println(p[i]); | Serial.println(i); |
delay(T); | delay(T); |
} | } |
for(int i=13; i>=0; i--){ | for(int i=13; i<=0; i--){ |
digitalWrite(p[i], HIGH); | digitalWrite(i, HIGH); |
digitalWrite(p[i], LOW); | digitalWrite(i, LOW); |
Serial.print(down: ); | Serial.print(down: ); |
Serial.println(p[i]); | Serial.println(i); |
delay(T); | delay(T); |
} | } |
} | } |
can someone please help me out for I haven’t programmed in a long time. The program on the left is correct, it’s an example from the help files. The program , I wrote, on the right does not want to do what I wanted it to do and that is go to the next for(). When i=13 it always goes to beginning loop() and ignores the second for(). as you can see it is identical to the example on the left excluding the array setup. I’ve spent many hours trying to figure this out. Could anybody help me and explain why my program does not go to that second for()??