50 - Yellow - SDO/MISO
51 - Green - SDI/MOSI
52 - Orange - SCK
53 - Blue - CS/SS
I downloaded the Adafruit MAX31856 library along with the Adafruit BusIO dependency using the package manager on Arduino IDE. Following that, I used the example "max31856_manual" from the MAX31856 library. Here is a shortened version of the example which I am currently using:
Code: Select all
// This example demonstrates doing a one-shot measurement "manually".
// Separate calls are made to trigger the conversion and then check
// for conversion complete. While this typically only takes a couple
// 100 milliseconds, that times is made available by separating these
// two steps.
#include <Adafruit_MAX31856.h>
// use hardware SPI, just pass in the CS pin
Adafruit_MAX31856 maxthermo = Adafruit_MAX31856(53);
void setup() {
Serial.begin(115200);
while (!Serial) delay(10);
Serial.println("MAX31856 thermocouple test");
if (!maxthermo.begin()) {
Serial.println("Could not initialize thermocouple.");
while (1) delay(10);
}
maxthermo.setThermocoupleType(MAX31856_TCTYPE_T);
Serial.println("T Type");
maxthermo.setConversionMode(MAX31856_ONESHOT_NOWAIT);
}
void loop() {
// trigger a conversion, returns immediately
maxthermo.triggerOneShot();
delay(500);
// check for conversion complete and read temperature
if (maxthermo.conversionComplete()) {
Serial.println(maxthermo.readThermocoupleTemperature());
} else {
Serial.println("Conversion not complete!");
}
}
If it helps I'm using Arduino IDE v1.8.18 on Windows 10