Skip to content

Instantly share code, notes, and snippets.

@cat-haines
Created September 6, 2014 23:36
Show Gist options
  • Save cat-haines/f8a1a9d488014a32c62d to your computer and use it in GitHub Desktop.
Save cat-haines/f8a1a9d488014a32c62d to your computer and use it in GitHub Desktop.
Super simple Electric Imp + Yo integration.
http.onrequest(function(req, resp) {
if (req.query != null && "username" in req.query) server.log("Got a YO from " + req.query.username);
device.send("toggleLed", null);
resp.send(200, "OK");
});
led <- hardware.pin9;
led.configure(DIGITAL_OUT,0);
agent.on("toggleLed", function(data) {
led.write(1-led.read());
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment