void setup() {
// initialize digital pin 13 as an output.
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);
pinMode(11, OUTPUT);
pinMode(12, OUTPUT);
pinMode(13, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(6, HIGH); // turn the LED on (HIGH is the voltage level)
digitalWrite(7, HIGH); // turn the LED on (HIGH is the voltage level)
digitalWrite(8, HIGH); // turn the LED on (HIGH is the voltage level)
digitalWrite(9, HIGH); // turn the LED on (HIGH is the voltage level)
digitalWrite(10, HIGH); // turn the LED on (HIGH is the voltage level)
digitalWrite(11, HIGH); // turn the LED on (HIGH is the voltage level)
digitalWrite(12, HIGH); // turn the LED on (HIGH is the voltage level)
digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(6, LOW); // turn the LED off by making the voltage LOW
digitalWrite(7, LOW); // turn the LED off by making the voltage LOW
digitalWrite(8, LOW); // turn the LED off by making the voltage LOW
digitalWrite(9, LOW); // turn the LED off by making the voltage LOW
digitalWrite(10, LOW); // turn the LED off by making the voltage LOW
digitalWrite(11, LOW); // turn the LED off by making the voltage LOW
digitalWrite(12, LOW); // turn the LED off by making the voltage LOW
digitalWrite(13, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
0 ความคิดเห็น:
แสดงความคิดเห็น