I created 9 LEDs and light them and watch them rotate around. I used pins 2 to 10. Bottom LED is 10. On the left from bottom to top 2 to 5. On the right, top to bottom 6 to 9. Green wires are grounds. Red wires go the the LED pins.
I used a while loop instead of the For loop that the video showed. I prefer to use while loops in code. I set my timer to 800 and start thisPin at position 2. When thisPin gets to 11, it resets to 2 to start over.
int timer = 800;
int thisPin = 2;
void setup() {
// put your setup code here, to run once:
for( int thisPin = 2; thisPin < 11; thisPin++)
pinMode(thisPin, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
while ( thisPin < 12 ) {
if (thisPin == 11) {
thisPin = 2;
}
digitalWrite(thisPin, HIGH);
delay(timer);
digitalWrite(thisPin, LOW);
thisPin++;
}
}