4. November 2010
<pre>int LED[] = {2,3,4,5,6,7,8,9,10,11}; long time = 0; int frequency = 60; void setup() { for (int i=0; i<=9; i++) { pinMode(LED[i], OUTPUT); } } void loop() { loop1(); loop2(); } void loop1() { for (int i=0; i<=9; i++) { digitalWrite(LED[i], HIGH); if (i!=0) { digitalWrite(LED[i-1], LOW); } delay(frequency); } } void loop2() { for (int i=9; i>=1; i--) { digitalWrite(LED[i], LOW); if(i!=1) { digitalWrite(LED[i-1], HIGH); delay(frequency); } } }