4 Demonstrates the use of a for() loop.
5 Lights multiple LEDs in sequence, then in reverse.
8 * LEDs from pins 2 through 9 to ground
11 - http://lab.piffa.net/schemi/8_led_single_res_bb.png
12 - http://lab.piffa.net/schemi/8_led_single_res_schem.png
15 http://www.arduino.cc/en/Tutorial/ForLoop
18 int timer = 100; // The higher the number, the slower the timing.
21 // use a for loop to initialize each pin as an output:
22 for (int thisPin = 2; thisPin <= 9; thisPin++) {
23 pinMode(thisPin, OUTPUT);
28 // loop from the lowest pin to the highest:
29 for (int thisPin = 2; thisPin <= 9; thisPin++) {
31 digitalWrite(thisPin, HIGH);
34 digitalWrite(thisPin, LOW);
37 // loop from the highest pin to the lowest:
38 for (int thisPin = 9; thisPin >= 2; thisPin--) {
40 digitalWrite(thisPin, HIGH);
43 digitalWrite(thisPin, LOW);