Last active
November 23, 2018 19:46
-
-
Save kimschles/e05ed0702848b2afde96d0e2d39e919a to your computer and use it in GitHub Desktop.
Two alternating lights on LilyPad
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
| /* | |
| LilyPad USB BLINK | |
| */ | |
| int firstledPin = 9; // onboard LED | |
| int secondledPin = 10; | |
| void setup() { | |
| Serial.begin(9600); // Sets up the serial window. Tools->Serial Monitor | |
| pinMode(firstledPin, OUTPUT); | |
| pinMode(secondledPin, OUTPUT); | |
| } | |
| void loop() { | |
| digitalWrite(firstledPin, HIGH); // turn LED on | |
| Serial.println("LED ON"); | |
| delay(1000); // wait one second | |
| digitalWrite(firstledPin, LOW); // turn LED off | |
| Serial.println("LED OFF"); | |
| delay(1000); // wait one second | |
| digitalWrite(secondledPin, HIGH); | |
| Serial.println("LED ON"); | |
| delay(2000); // wait two seconds | |
| digitalWrite(secondledPin, LOW); // turn LED off | |
| Serial.println("LED OFF"); | |
| delay(2000); // wait two seconds | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment