From c742fe9ad47b1e0e760f547c22b8c7320e086502 Mon Sep 17 00:00:00 2001 From: mrmcwethy Date: Thu, 8 Feb 2018 08:10:45 -0700 Subject: [PATCH] addedexamples folder and simple example --- examples/simple.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 examples/simple.py diff --git a/examples/simple.py b/examples/simple.py new file mode 100644 index 0000000..a8fd53f --- /dev/null +++ b/examples/simple.py @@ -0,0 +1,15 @@ +import time +import board +import busio +import digitalio +import adafruit_max31855 + +spi = busio.SPI(board.SCK, MOSI=board.MOSI, MISO=board.MISO) +cs = digitalio.DigitalInOut(board.D5) + +max31855 = adafruit_max31855.MAX31855(spi, cs) +while True: + tempC = max31855.temperature + tempF = tempC * 9 / 5 + 32 + print('Temperature: {} C {} F '.format(tempC, tempF)) + time.sleep(2.0)