Skip to content

Instantly share code, notes, and snippets.

@omundy
Created May 17, 2012 15:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save omundy/2719543 to your computer and use it in GitHub Desktop.
Save omundy/2719543 to your computer and use it in GitHub Desktop.
Print reading from each analog-in pin on a BeagleBone using mrBBIO
# 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