Code:
int ledPins[] = {1,2,3,4,5,6};
void setup()
{
for(int x=0; x<7;x++)
{
pinMode(ledPins[x],OUTPUT);
}
}
void loop()
{
int delaytime = 800;
for(int x=0; x<=6; x+=2)
{
digitalWrite (ledPins [x], HIGH);
delay(delaytime);
}
for(int x=1; x<=5; x+=2)
{
digitalWrite (ledPins [x], HIGH);
delay(delaytime);
}
for(int x=6; x>=0; x-=2)
{
digitalWrite (ledPins [x], LOW);
delay(delaytime);
}
for(int x=5; x>=1; x-=2)
{
digitalWrite (ledPins [x], LOW);
delay(delaytime);
}
}
Visual Evidence:
No comments:
Post a Comment