Skip to content

Instantly share code, notes, and snippets.

@madhephaestus
Last active April 16, 2016 04:39
Show Gist options
  • Save madhephaestus/5c7e906f80cee9872a56 to your computer and use it in GitHub Desktop.
Save madhephaestus/5c7e906f80cee9872a56 to your computer and use it in GitHub Desktop.
// Set up the analog channel
AnalogInputChannel ana = new AnalogInputChannel(dyio.getChannel(12));
//disable the async so we can read just this channel
ana.setAsync(false);
//Loop forever printing out the voltage on the pin
while(!Thread.interrupted()){
System.out.println(ana.getVoltage());
Thread.sleep(100);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment