Created
November 20, 2015 16:37
-
-
Save thisMagpie/fd43df8c3f0a31241db7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
from webiopi.devices.analog import MCP3208 | |
ADC0 = MCP3208(chip = 0) | |
print ADC0.analogReadAllVolt() | |
print("Analog Count ", ADC0.analogCount()) | |
print("Analog Resolution ", ADC0.analogResolution()) | |
print("Analog Maximum ", ADC0.analogMaximum()) | |
print("Analog Reference ", ADC0.analogReference()) | |
for i in range(ADC0.analogCount()): | |
print("Analog Read Channel ", i, ADC0.analogRead(i)) | |
print("Analog Read Voltage ", i, ADC0.analogReadVolt(i)) | |
print " " | |
print("Analog Read ", ADC0.analogReadAll()) | |
print("Analog Read Float ", ADC0.analogReadAllFloat()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment