// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin 13 as an output.
pinMode(13, OUTPUT);
pinMode(12, OUTPUT);
pinMode(11, OUTPUT);
pinMode(10, OUTPUT);
pinMode(9, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
//for(int i=9;i<=13;i++){
digitalWrite(random(9,14), HIGH); // turn the LED on (HIGH is the voltage level)
delay(10);
digitalWrite(random(9,14), LOW); // turn the LED off by making the voltage LOW
delay(10);
//}
//digitalWrite(12, HIGH); // turn the LED on (HIGH is the voltage level)
//digitalWrite(12, LOW); // turn the LED off by making the voltage LOW
//delay(1000); //延遲時間
//digitalWrite(11, HIGH); // turn the LED on (HIGH is the voltage level)
//digitalWrite(11, LOW); // turn the LED off by making the voltage LOW
//delay(1000);
//digitalWrite(10, HIGH); // turn the LED on (HIGH is the voltage level)
//digitalWrite(10, LOW); // turn the LED off by making the voltage LOW
//delay(1000);
//digitalWrite(9, HIGH); // turn the LED on (HIGH is the voltage level)
//digitalWrite(9, LOW); // turn the LED off by making the voltage LOW
//delay(1000);
}
pinMode(13,OUTPUT); =>設13接孔為輸出
digitalWrite(13,HIGH) =>亮 LOW就是暗
delay是指延遲,1000=1秒
沒有留言:
張貼留言