Skip to content

Instantly share code, notes, and snippets.

@fxprime
Created December 3, 2024 11:39
Show Gist options
  • Save fxprime/9e34bbdfe560c20324c8d71ce83ed181 to your computer and use it in GitHub Desktop.
Save fxprime/9e34bbdfe560c20324c8d71ce83ed181 to your computer and use it in GitHub Desktop.
/**
* ModuleMore Co., Ltd.
* @date 2024-12-03
*
* Wiring
* | MAX31855 | ESP32 |
* |----------|-------|
* | Vin | 3.3V |
* | Gnd | Gnd |
* | SCK | 26 |
* | CS | 25 |
* | SO | 17 |
*
*/
#include "MAX31855.h" // https://github.com/RobTillaart/MAX31855_RT
const int selectPin = 25; //CS
const int dataPin = 17; //DO
const int clockPin = 26; //SCK
MAX31855 thermoCouple(selectPin, dataPin, clockPin);
void setup()
{
Serial.begin(115200);
Serial.println(__FILE__);
Serial.print("MAX31855_VERSION : ");
Serial.println(MAX31855_VERSION);
Serial.println();
delay(250);
SPI.begin();
thermoCouple.begin();
}
void loop()
{
int status = thermoCouple.read();
Serial.print("stat:\t\t");
Serial.println(status);
float internal = thermoCouple.getInternal();
Serial.print("internal:\t");
Serial.println(internal, 3);
float temp = thermoCouple.getTemperature();
Serial.print("temperature:\t");
Serial.println(temp, 3);
delay(100);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment