adafruit-beaglebone-io-python/source/examples/python/i2ctmp101.py
2017-07-31 15:43:21 -04:00

12 lines
211 B
Python
Executable file

#!/usr/bin/env python3
# Read a TMP101 sensor
import smbus
import time
bus = smbus.SMBus(1)
address = 0x49
while True:
temp = bus.read_byte_data(address, 0)
print (temp, end="\r")
time.sleep(0.25)