https://github.com/krzychb/toit-max6675
Driver for MAX6675 cold junction compensated K-thermocouple to digital converter
https://github.com/krzychb/toit-max6675
esp32 jaguar max6675 toit
Last synced: over 1 year ago
JSON representation
Driver for MAX6675 cold junction compensated K-thermocouple to digital converter
- Host: GitHub
- URL: https://github.com/krzychb/toit-max6675
- Owner: krzychb
- License: mit
- Created: 2023-07-01T23:40:32.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-07-02T04:17:33.000Z (almost 3 years ago)
- Last Synced: 2024-10-23T20:12:23.873Z (over 1 year ago)
- Topics: esp32, jaguar, max6675, toit
- Homepage:
- Size: 298 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# MAX6675
Toit driver for the MAX6675, a cold junction compensated K-thermocouple to digital converter. The driver implements the reading of data from MAX6675 over ESP32's native SPI interface or using GPIO pin bit banging.
# Installation
```bash
jag pkg install github.com/krzychb/toit-max6675
```
# Usage
The following example is using bit banging of GPIO pins.
```toit
import gpio
import max6675
// ESP32 GPIO # // MAX6675 Function (Pin)
cs_gpio ::= gpio.Pin 12 // Chip select (CS)
so_gpio ::= gpio.Pin 13 // Serial output (SO)
sck_gpio ::= gpio.Pin 14 // Serial clock (SCK)
main:
device := max6675.DriverBitBang
--cs=cs_gpio
--so=so_gpio
--sck=sck_gpio
max6675 := max6675.Driver device
while true:
print "Temperature: $(%0.1f max6675.read.temperature)°C"
sleep --ms=500
```
See [max6675.toit](examples/max6675.toit) for an example of reading the temperature from MX6675 using SPI interface of ESP32.
# About
- [Toit](https://toitlang.org/) is a modern high-level language designed specifically for microcontrollers.
- [MAX6675](https://datasheets.maximintegrated.com/en/ds/MAX6675.pdf) is a cold junction compensated K-thermocouple to-digital converter able to read temperatures in the range from 0°C to +1024°C.
- [ESP32](https://www.espressif.com.cn/) is a feature-rich MCU with integrated Wi-Fi and Bluetooth connectivity for a wide range of applications.
# Resources
- [MAX6675 Cold-Junction-Compensated K-Thermocouple-to-Digital Converter (datasheet)](https://datasheets.maximintegrated.com/en/ds/MAX6675.pdf)
# Acknowledgments
- [Florian Loitsch](https://github.com/floitsch) was extremely helpful providing me with several tips on how to implement the driver.