Created
February 22, 2013 14:57
-
-
Save cat-haines/5014004 to your computer and use it in GitHub Desktop.
Electric Imp code for polling an analog input every half second.
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
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