//LED 同時閃爍
const byte LEDs[] = {6,7,8,9,10,11,12,13};
const byte total = sizeof(LEDs);
void setup()
{
for (byte j=0; j<=total; j++)
{
pinMode(LEDs[j], OUTPUT);
}
}
//=============================
void loop() {
{
for (byte j=0; j<=total ; j++)
digitalWrite(LEDs[j], HIGH);
delay (250);
for (byte j=0; j<=total ; j++)
digitalWrite(LEDs[j], LOW);
delay(250);
} // for
} //loop
沒有留言:
張貼留言