TEMP sample

This commit is contained in:
James Bowman 2019-03-17 12:01:43 -07:00
parent 35c96f1446
commit 68d21a245b
1 changed files with 14 additions and 0 deletions

View File

@ -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)