2012年4月15日 星期日

HW09_01 : Blinking LED

/*
Blink
Turns on an LED on for one second, then off for one second, repeatedly.
This example code is in the public domain.
*/

void setup() {
// initialize the digital pin as an output.
// Pin 13 has an LED connected on most Arduino boards:

pinMode(1, OUTPUT);
}

void loop() {

digitalWrite(1, HIGH); // set the LED on
delay(500); // wait for a second
digitalWrite(1, LOW); // set the LED off
delay(500); // wait for a second

}

********************************************************************
I knew how to make led turn off and on with Arduino. It show Port1 only is turned on and turned off.

沒有留言:

張貼留言