Code: Select all
#include "Adafruit_MAX31855.h"
int GND = 4;
int VIN = 2;
int thermoDO = 5;
int thermoCS = 6;
int thermoCLK = 7;
Adafruit_MAX31855 thermocouple(thermoCLK, thermoCS, thermoDO);
void setup() {
Serial.begin(9600);
pinMode(GND,OUTPUT);
digitalWrite(GND,LOW);
pinMode(VIN,OUTPUT);
digitalWrite(VIN,HIGH);
Serial.println("MAX31855 test");
// wait for MAX chip to stabilize
delay(500);
if (digitalRead(V3OUT)) {
Serial.println("MAX31855 V3 IS HIGH");
}
}
void loop() {
// basic readout test, just print the current temp
Serial.print("Internal Temp = ");
Serial.println(thermocouple.readInternal());
double c = thermocouple.readCelsius();
if (isnan(c)) {
Serial.println("Something wrong with thermocouple!");
} else {
Serial.print("C = ");
Serial.println(c);
}
//Serial.print("F = ");
//Serial.println(thermocouple.readFarenheit());
delay(1000);
}