Skip to content

Instantly share code, notes, and snippets.

@dpjanes
Last active September 17, 2015 21:24
Show Gist options
  • Save dpjanes/2f4cebe6a6d7aaa14ede to your computer and use it in GitHub Desktop.
Save dpjanes/2f4cebe6a6d7aaa14ede to your computer and use it in GitHub Desktop.
IOTQL Example - Turn on LED when Button Pressed
CREATE THING JohnnyFiveButton WITH pin = 4, meta:name = "The Button";
CREATE THING JohnnyFiveLED WITH pin = 6, meta:name = "The LED";
CREATE RULE
LED
WHERE
meta:name = "The Button"
BEGIN
SET
state:on = $_$state:on
WHERE
meta:name = "The LED"
END;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment