Last active
December 21, 2015 22:59
-
-
Save asilyihong/6379303 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Blink | |
Turns on an LED on for one second, then off for one second, repeatedly. | |
This example code is in the public domain. | |
*/ | |
// Pin 13 has an LED connected on most Arduino boards: | |
int led1 = 13; | |
// Pin 10 has an LED connected on most Arduino boards: | |
int led2 = 10; | |
void setup() { | |
// initialize the digital pin as an output. | |
pinMode(led1, OUTPUT); | |
pinMode(led2, OUTPUT); | |
} | |
void loop() { | |
digitalWrite(led1, HIGH); // set the LED1 on | |
digitalWrite(led2, LOW); // set the LED2 off | |
delay(1000); // wait for a second | |
digitalWrite(led1, LOW); // set the LED1 off | |
digitalWrite(led2, HIGH); // set the LED2 on | |
delay(1000); // wait for a second | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment