max31856_simpletest.py
1 import board 2 import busio 3 import digitalio 4 import adafruit_max31856 5 6 # create a spi object 7 spi = busio.SPI(board.SCK, board.MOSI, board.MISO) 8 9 # allocate a CS pin and set the direction 10 cs = digitalio.DigitalInOut(board.D0) 11 cs.direction = digitalio.Direction.OUTPUT 12 13 # create a thermocouple object with the above 14 thermocouple = adafruit_max31856.MAX31856(spi, cs) 15 16 # print the temperature! 17 print(thermocouple.temperature)