Tuckie / max31855

Raspberry Pi driver for MAX31855 Cold-Junction Compensated Thermocouple-to-Digital Converter
MIT License
53 stars 30 forks source link

Python driver for MAX31855 Cold-Junction Compensated Thermocouple-to-Digital Converter

Requires:

Basic use


#!/usr/bin/python
from max31855 import MAX31855, MAX31855Error

cs_pin = 24
clock_pin = 23
data_pin = 22
units = "f"
thermocouple = MAX31855(cs_pin, clock_pin, data_pin, units)
print(thermocouple.get())
thermocouple.cleanup()

Note: these are the GPIO pin numbers, not the header pin numbers.
This can be overriden by passing GPIO.BOARD as the fifth init parameter.

See max31855.py for a multi-chip example.

Changelog

V2.0

NOTE: If you were using the previous hardware-based version, you will have to update your code to match the new init function: MAX31855(cs_pin, clock_pin, data_pin, units)

V1.0