Created
October 28, 2015 01:30
-
-
Save cat-haines/0ed6bba5530a25baa75e to your computer and use it in GitHub Desktop.
Hello World example for Electric Imp
This file contains 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
led <- hardware.pin9; // LED Pin | |
ledState <- 0; // Current state of the LED | |
// Configure the LED | |
led.configure(DIGITAL_OUT, ledState); | |
function blink() { | |
// run blink() again in half a second | |
imp.wakeup(0.5, blink); | |
// Flip the state, and write it to the pin | |
ledState = 1 - ledState; | |
led.write(ledState); | |
} | |
// Call blink() to start the loop | |
blink(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment