Skip to content

Instantly share code, notes, and snippets.

@erjjones
Created January 19, 2013 16:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erjjones/4573536 to your computer and use it in GitHub Desktop.
Save erjjones/4573536 to your computer and use it in GitHub Desktop.
Electric Imp System Light
////////////////////
/// 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