Max31856

This library provides the driver for the MAX31856 thermocouple board from Adafruit. I have tested and use this driver with both a custom PCB that has a MAX31856 as well as the Adafruit breakout board.

Notice: I have only tested the board with a type K thermocouple. If you have another one and it is not working as expected, please let me know and I will try and help you get it sorted.

Reading

# Open the SPI bus to your MAX.
{:ok, max} = Max31856.open("spidev0.0", thermocouple: :k, filter: :hz_50)
# If you provide invalid options, you will get an error.
Max31856.Config.new(averaging: 1, thermocouple: :foo)
{:error, {:invalid_option, :thermocouple, :foo}}
# Read a measurement to get the temperature in Celcius.
{:ok, 23.4} = Max31856.measure(max)

Installation

Add max_31856 to your list of dependencies in mix.exs:

def deps do
[
{:max_31856, "~> 0.1.0"}
]
end

Documentation is available at https://hexdocs.pm/max_31856.