Skip to content

Instantly share code, notes, and snippets.

@omundy
Created May 17, 2012 12:46
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/2718676 to your computer and use it in GitHub Desktop.
Save omundy/2718676 to your computer and use it in GitHub Desktop.
BeagleBone test and print all analog-in pins
# analog-test-all-pins.py - Owen Mundy
# Print reading from each analog-in pin on a BeagleBone
# with a short delay between each
# This example is in the public domain
import os,time
i = 1
while(True):
os.system("cat /sys/bus/platform/devices/tsc/ain" + str(i))
print " - AIN" + str(i-1)
if i==7:
i=1
time.sleep(.5)
print "------"
else:
i+=1
time.sleep(.1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment