diff --git a/python/samples/EDS-TEMP.py b/python/samples/EDS-TEMP.py new file mode 100644 index 0000000..8c896e0 --- /dev/null +++ b/python/samples/EDS-TEMP.py @@ -0,0 +1,14 @@ +import sys +import time + +from i2cdriver import I2CDriver, EDS + +if __name__ == '__main__': + i2 = I2CDriver(sys.argv[1]) + + d = EDS.Temp(i2) + for i in range(20): + celsius = d.read() + fahrenheit = celsius * 9/5 + 32 + sys.stdout.write("%.1f C %.1f F\n" % (celsius, fahrenheit)) + time.sleep(.1)