Simple test

Ensure your device works with this simple test.

examples/max31855_simpletest.py
 1# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
 2# SPDX-License-Identifier: MIT
 3
 4import time
 5import board
 6import digitalio
 7import adafruit_max31855
 8
 9spi = board.SPI()
10cs = digitalio.DigitalInOut(board.D5)
11
12max31855 = adafruit_max31855.MAX31855(spi, cs)
13while True:
14    tempC = max31855.temperature
15    tempF = tempC * 9 / 5 + 32
16    print("Temperature: {} C {} F ".format(tempC, tempF))
17    time.sleep(2.0)