void setup() {
// initialize the digital pin as an output. // 14 LED Pins are connected to Arduino board: for(int i=0;i<14;i++) pinMode(i, OUTPUT); } void loop() { for(int i = 0; i<=7; i++) { digitalWrite(i, HIGH); // set the LED on delay(random(50,100)); // wait for random second digitalWrite(i, LOW); // set the LED off delay(random(50,100)); // wait for random second digitalWrite(i+7, HIGH); // set the LED on delay(random(50,100)); // wait for random second digitalWrite(i+7, LOW); // set the LED off delay(random(50,100)); // wait for random second } }
沒有留言:
張貼留言