Created
January 19, 2013 16:35
-
-
Save erjjones/4573536 to your computer and use it in GitHub Desktop.
Electric Imp System Light
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
//////////////////// | |
/// System Light /// | |
//////////////////// | |
ledState <- 0; // Variable to represent LED state | |
inhibit <- 0; // Variable to represent LED inhibit state | |
hardware.pin9.write(1); // System Light | |
// input class for LED control channel | |
class input extends InputPort | |
{ | |
name = "LED control" | |
type = "number" | |
function set(value) | |
{ | |
inhibit = 1; | |
} | |
} | |
// Configure pin 9 as an open drain output with internal pull up | |
hardware.pin9.configure(DIGITAL_OUT_OD_PULLUP); | |
// Register with the server | |
imp.configure("Webponics", [input()], []); | |
// End of code. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment