Skip to content

Instantly share code, notes, and snippets.

@cat-haines
Created February 22, 2013 14:57
Show Gist options
  • Save cat-haines/5014004 to your computer and use it in GitHub Desktop.
Save cat-haines/5014004 to your computer and use it in GitHub Desktop.
Electric Imp code for polling an analog input every half second.
imp.configure("Analog In", [], []);
function readPots()
{
local p = hardware.pin5.read();
server.show(p);
imp.wakeup(0.5, readPots);
}
hardware.pin5.configure(ANALOG_IN);
readPots();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment