Created
May 17, 2012 15:10
-
-
Save omundy/2719543 to your computer and use it in GitHub Desktop.
Print reading from each analog-in pin on a BeagleBone using mrBBIO
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
# analog-test-all-pins.py - Owen Mundy | |
# Print reading from each analog-in pin on a BeagleBone | |
# with a short delay between each | |
# using mrBBIO by Matt Richardson: | |
# https://github.com/mrichardson23/mrBBIO | |
# This example is in the public domain | |
from mrbbio import * | |
def setup(): | |
#pinMode("P9.36", INPUT) | |
pass | |
def loop(): | |
print "-----" | |
for key, value in analogPinDef.items(): | |
# There is currently an error in mrBBIO, as the analogPinDef dict points to: | |
# ain[0-6] in /sys/devices/platform/tsc/ while it should point at: ain[1-7] | |
if key!="P9.39": | |
print analogRead(key) + " - " + value | |
delay(100) | |
delay(1000) | |
run (setup,loop) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment