Hi all,
I am putting together a kiln controller and just got the adafruit max31855 breakout board to interface my thermocouple and my arduino uno. In looking through the example sketch that they provide with the adafruit max31855 library, there are several things that i don't understand and am wondering if anyone can tell me why they are included and/or what they do.
In the header: I understand the inclusion of the adafruit_MAX31855.h and liquidcrystal.h libraries, but why are the SPI.h and Wire.h libraries included? I can't see where they are used in the sketch
then under setup, what does this do, I have no clue at all:
#ifndef ESP8266
while (!Serial); // will pause Zero, Leonardo, etc until serial console opens
#endif
Thanks so much for any insight you can offer!
Jesse
#include <SPI.h>
#include <Wire.h>
#include "Adafruit_MAX31855.h"
#include <LiquidCrystal.h>
// Example creating a thermocouple instance with software SPI on any three
// digital IO pins.
#define MAXDO 3
#define MAXCS 4
#define MAXCLK 5
// Initialize the Thermocouple
Adafruit_MAX31855 thermocouple(MAXCLK, MAXCS, MAXDO);
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);
void setup() {
#ifndef ESP8266
while (!Serial); // will pause Zero, Leonardo, etc until serial console opens
#endif
Serial.begin(9600);
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
lcd.clear();
lcd.print("MAX31855 test");
// wait for MAX chip to stabilize
delay(500);
if (!thermocouple.begin()) {
lcd.print("ERROR.");
while (1) delay(10);
}
lcd.print("DONE.");
}
void loop() {
// basic readout test, just print the current temp
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Int. Temp = ");
lcd.println(thermocouple.readInternal());
Serial.print("Int. Temp = ");
Serial.println(thermocouple.readInternal());
double c = thermocouple.readCelsius();
lcd.setCursor(0, 1);
if (isnan(c))
{
lcd.print("T/C Problem");
}
else
{
lcd.print("C = ");
lcd.print(c);
lcd.print(" ");
Serial.print("Thermocouple Temp = *");
Serial.println(c);
}
delay(1000);
} [