// LED muj potok
const int lowestPin = 2;
const int highestPin = 9;
int a=0;
int b=0;
int c=0;
int thisPin=0;
void setup() {
// nastavení pinu od 2 do 9 LEDky jako výstupu
for(int thisPin = lowestPin;thisPin <= highestPin;thisPin++){
pinMode(thisPin,OUTPUT); // nastavení pinu jako výstupu
}
}
void loop() {
for (thisPin = lowestPin;thisPin <= highestPin;thisPin++) {
a=thisPin;
;
switch (a) {
case 2:
b = highestPin;
c = highestPin-1;
break;
case 3:
c = highestPin;
b = lowestPin;
break;
default:
b = a-1;
c = a-2;
break;
}
analogWrite(a,255);
analogWrite(b,130);
analogWrite(c,80);
// zapnout tuto LEDku
delay(1000);
analogWrite(a,0);
analogWrite(b,0);
analogWrite(c,0);
}
}