2014-01-02 08:26:26 -05:00
|
|
|
//
|
2015-03-09 15:08:11 -04:00
|
|
|
// FILE: max31855_demo0.ino
|
2014-01-02 08:26:26 -05:00
|
|
|
// AUTHOR: Rob Tillaart
|
2015-03-09 15:08:11 -04:00
|
|
|
// VERSION: 0.1.02
|
2014-01-02 08:26:26 -05:00
|
|
|
// PURPOSE: thermocouple lib demo application
|
|
|
|
// DATE: 2014-01-01
|
|
|
|
// URL:
|
|
|
|
//
|
|
|
|
// Released to the public domain
|
|
|
|
//
|
|
|
|
|
|
|
|
#include "MAX31855.h"
|
|
|
|
|
|
|
|
const int doPin = 7;
|
|
|
|
const int csPin = 6;
|
|
|
|
const int clPin = 5;
|
|
|
|
|
|
|
|
MAX31855 tc(clPin, csPin, doPin);
|
|
|
|
|
|
|
|
void setup()
|
|
|
|
{
|
|
|
|
Serial.begin(115200);
|
2015-03-09 15:08:11 -04:00
|
|
|
Serial.print("Start max31855_demo0: ");
|
2014-01-02 08:26:26 -05:00
|
|
|
Serial.println(MAX31855_VERSION);
|
|
|
|
Serial.println();
|
|
|
|
|
|
|
|
tc.begin();
|
|
|
|
}
|
|
|
|
|
|
|
|
void loop()
|
|
|
|
{
|
|
|
|
int status = tc.read();
|
|
|
|
Serial.print("stat:\t\t");
|
|
|
|
Serial.println(status);
|
|
|
|
|
2015-03-09 15:08:11 -04:00
|
|
|
double internal = tc.getInternal();
|
2014-01-02 08:26:26 -05:00
|
|
|
Serial.print("internal:\t");
|
|
|
|
Serial.println(internal);
|
|
|
|
|
2015-03-09 15:08:11 -04:00
|
|
|
double temp = tc.getTemperature();
|
2014-01-02 08:26:26 -05:00
|
|
|
Serial.print("temperature:\t");
|
|
|
|
Serial.println(temp);
|
|
|
|
delay(1000);
|
|
|
|
}
|
|
|
|
|
|
|
|
|