Hello...I have been working out of a book and I thought of adding some extra oomph. So, I read the book, "Getting Started with BeagleBone," by Monk and added some after seeing this fellow's software.
At first, I had a couple of interruptions with software and hardware but soon after learning that I need to call my pin before the while statement, I was good to go.
I also had some assistance from a nice person on the #beagle Freenode chat that is hosted by the BBB.io people.
import Adafruit_BBIO.ADC as ADC import time sensor_pin = 'P9_39' ADC.setup() with open('loveAndTemp.txt', 'w') as file: while True: reading = ADC.read(sensor_pin) millivolts = reading * 1800 # 1.8V reference = 1800 mV temp_c = (millivolts - 500) / 10 temp_f = (temp_c * 9/5) + 32 print('mv=%d C=%d F=%d' % (millivolts, temp_c, temp_f)) file.write('mv=%d C=%d F=%d \n' % (millivolts, temp_c, temp_f) time.sleep(1)
Did you replicate this project? Share it!I made one
Love this project? Think it could be improved? Tell us what you think!