Last active
December 11, 2015 03:08
-
-
Save cat-haines/4535159 to your computer and use it in GitHub Desktop.
electric imp code to make an led blink
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
// Everyone loves blinking LEDs, now you can too | |
local ledState = 0; | |
function blink() | |
{ | |
if (ledState == 1) | |
ledState = 0; | |
else | |
ledState = 1; | |
hardware.pin9.write(ledState); | |
imp.wakeup(0.1, blink); | |
} | |
hardware.pin9.configure(DIGITAL_OUT_OD_PULLUP); | |
imp.configure("blinkblink", [], []); | |
blink(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment