2015-03-09 15:08:11 -04:00
|
|
|
//
|
|
|
|
// FILE: max31855_demo5.ino
|
|
|
|
// AUTHOR: Rob Tillaart
|
2015-12-06 10:48:50 -05:00
|
|
|
// VERSION: 0.1.01
|
2015-03-09 15:08:11 -04:00
|
|
|
// PURPOSE: thermocouple lib demo application
|
|
|
|
// DATE: 2014-01-02
|
2015-12-06 10:48:50 -05:00
|
|
|
// URL: http://forum.arduino.cc/index.php?topic=208061
|
2015-03-09 15:08:11 -04:00
|
|
|
//
|
|
|
|
// 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);
|
|
|
|
Serial.print("Start max31855_demo5: ");
|
|
|
|
Serial.println(MAX31855_VERSION);
|
|
|
|
Serial.println();
|
|
|
|
|
|
|
|
tc.begin();
|
|
|
|
tc.read();
|
|
|
|
double t1 = tc.getTemperature();
|
|
|
|
Serial.print(" temp before:\t");
|
|
|
|
Serial.println(t1, 2);
|
|
|
|
|
|
|
|
double o = tc.getOffset();
|
|
|
|
Serial.print("offset before:\t");
|
|
|
|
Serial.println(o, 2);
|
|
|
|
|
|
|
|
tc.setOffset(3.14);
|
|
|
|
o = tc.getOffset();
|
|
|
|
Serial.print(" offset after:\t");
|
|
|
|
Serial.println(o, 2);
|
|
|
|
|
|
|
|
tc.read();
|
|
|
|
double t2 = tc.getTemperature();
|
|
|
|
Serial.print(" temp after:\t");
|
2015-12-06 10:48:50 -05:00
|
|
|
Serial.println(t2, 2);
|
2015-03-09 15:08:11 -04:00
|
|
|
|
|
|
|
Serial.print(" temp delta:\t");
|
|
|
|
Serial.println(abs(t1 - t2), 2);
|
|
|
|
|
|
|
|
Serial.println("\ndone...");
|
|
|
|
}
|
|
|
|
|
|
|
|
void loop()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|