From 68d21a245bbfea8ca4aaf0e8f8326a3e9a6860fc Mon Sep 17 00:00:00 2001 From: James Bowman Date: Sun, 17 Mar 2019 12:01:43 -0700 Subject: [PATCH] TEMP sample --- python/samples/EDS-TEMP.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 python/samples/EDS-TEMP.py 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)