esp8266_max6675
esp8266_max6675 copied to clipboard
A MAX6675 thermo-couple driver for esp8266
esp8266_max6675
A MAX6675 thermo-couple driver for esp8266.
It is a direct port of the Arduino library found at https://github.com/adafruit/MAX6675-library
It uses 3 GPIO pins so it is possible to use an esp-1.
But you will have to reappropriate your RX pin. Make sure that you don't have your max6675 connected to the RX pin while flashing or it will vent the magic smoke.
default pins
| MAX6675 | ESP8266 |
|---|---|
| !CS | GPIO2 |
| SCK | GPIO0 |
| SO | GPIO3 (RX) |
I've made all of the pin assignments configurable, so now you must tell the init method what pins you want to use.
void max6675_init(uint16_t icsPin, uint16_t clockPin, uint16_t soPin);
The makefile is copied from esp_mqtt.
###Building and installing:
First you need to install the sdk and the easy way of doing that is to use esp_open_sdk.
You can put that anywhere you like (/opt/local/esp-open-sdk, /esptools etc etc)
Then you could create a small setenv.sh file, containing the location of your newly compiled sdk and other platform specific info;
export SDK_BASE=/opt/local/esp-open-sdk/sdk
export PATH=${SDK_BASE}/../xtensa-lx106-elf/bin:${PATH}
export ESPPORT=/dev/ttyO0
(or setup your IDE to do the same)
To make a clean build, flash and connect to the esp console you just do this in a shell:
source setenv.sh # This is only needed once per session
make clean && make test
You won't be needing esptool, the makefile only uses esptool.py (provided by esp-open-sdk)
I have tested this with sdk v0.9.5 and v0.9.4 (linux & mac)