max6675-hal
An embedded-hal driver for the MAX6675 digital thermocouple converter.
Usage
This example code will change depending on which HAL device driver you're
using. An arduino-hal project's SPI isn't like that of an esp32-hal
project.
However, you only need to focus on your device's SPI implementation!
(thanks, embedded-hal 1.0 ☺️)
Your SPI settings should use MSB (most significant bit) first, target a clock speed of at least 4mhz, and utilize SPI Mode 1.
// first, define what pins you're connecting to
let so_pin = pins..into_pull_up_input;
let cs_pin = pins..into_output;
let sck_pin = pins..into_output;
// you may need a mosi pin for your device's SPI, though the max6675 doesn't use one.
// if so, just pick some pin that you're not using ☺️
let dummy_mosi = pins..into_output;
let = device-new;
let mut max = new?; // your spi and chip select here
let temp = max.read_celsius? // ayo! we got the temperature
Note
This crate re-exports a Temperature type from another crate, simmer.
You can change and play with the temperatures in various ways, so feel free
to check out its docs for more info.
Contributions
Contributions are welcome to this project! Since it's pretty small, feel free to submit a PR whenever. You can also make an issue - I'll likely get to it soon!
Help
Please don't hesitate to make an issue if you experience any problems!
If you can, please submit a hw-probe report
alongside any error messages or useful logs you have!