int led[]={2,3,4,5,6,7,8,9};
int j=0;
void setup() {
// put your setup code here, to run once:
for(int i=0;i<=7;i++)
{
pinMode(led[i],OUTPUT);
}
}
void loop() {
// put your main code here, to run repeatedly:
for(int i=0;i<=7;i++)
{
digitalWrite(led[i],LOW);
}
digitalWrite(led[j],HIGH); delay(1000);
digitalWrite(led[j],LOW);
j++;
if(j==8) j=0;
}
沒有留言:
張貼留言