int i;
// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
for(i=13;i>8;i--)
pinMode(i, OUTPUT);
}
// the loop routine runs over and over again forever:
void loop() {
for(i=13;i>8;i--){
digitalWrite(i, HIGH); // turn the LED on (HIGH is the voltage level)
delay(100); // wait for a second
digitalWrite(i, LOW); // turn the LED off by making the voltage LOW
}
for(i=9;i<14;i++){
digitalWrite(i, HIGH); // turn the LED on (HIGH is the voltage level)
delay(100); // wait for a second
digitalWrite(i, LOW); // turn the LED off by making the voltage LOW
}
}


沒有留言:
張貼留言