Temperature Sensor
TMP006
#!/usr/bin/env python
from __future__ import print_function
import time, sys, atexit
from upm import pyupm_tmp006 as TMP006
def main():
# Instantiate the Infrared-Thermopile Sensor on I2C on bus 1
mySensor = TMP006.TMP006(2)
# activate periodic measurements
mySensor.setActive();
while(1):
print("Temperature : "+str(mySensor.getTemperature(True)))
hex(mySensor.getConfig())
time.sleep(.5)
# Print out temperature value and config-reg in hex every 0.5 seconds
if __name__ == '__main__':
main()Last updated