Animation LEDS
Marériel:
- 10 Leds
- 10 résistance 220 Ω
- 12 fils
int led1=1, led2=2, led3=3, led4=4, led5=5, led6=6, led7=7, led8=8, led9=9, led10=10;
void serie1()
{
for(int x=0; x <=10; x++)
{
digitalWrite(x, HIGH);
delay(100);
}
}
void serie2()
{
for(int y=0; y <=10; y++)
{
digitalWrite(y, LOW);
delay(100);
}
}
void serie3()
{
for(int x=0; x <=11; x++)
{
digitalWrite(x, HIGH);
delay(100);
digitalWrite(x - 1, LOW);
}
}
void serie4()
{
for(int x=0; x <=10; x++)
{
digitalWrite(x, HIGH);
delay(100);
digitalWrite(x, LOW);
}
}
void serie5()
{
for(int a=1, b=6; a <=5, b <=10; a++, b++)
{
digitalWrite(a, HIGH);
digitalWrite(b, HIGH);
delay(100);
digitalWrite(a, LOW);
digitalWrite(b, LOW);
}
}
void setup() {
for(int n=0; n <=10; n++)
{
pinMode(n, OUTPUT);
}
}
void loop() {
serie5();
serie5();
serie1();
serie2();
serie4();
serie3();
}