2015-03-09 15:08:11 -04:00
|
|
|
//
|
|
|
|
// FILE: max31855_demo5.ino
|
|
|
|
// AUTHOR: Rob Tillaart
|
2017-07-26 18:48:32 -04:00
|
|
|
// VERSION: 0.1.2
|
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();
|
2017-07-26 18:48:32 -04:00
|
|
|
float t1 = tc.getTemperature();
|
2015-03-09 15:08:11 -04:00
|
|
|
Serial.print(" temp before:\t");
|
|
|
|
Serial.println(t1, 2);
|
|
|
|
|
2017-07-26 18:48:32 -04:00
|
|
|
float o = tc.getOffset();
|
2015-03-09 15:08:11 -04:00
|
|
|
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();
|
2017-07-26 18:48:32 -04:00
|
|
|
float t2 = tc.getTemperature();
|
2015-03-09 15:08:11 -04:00
|
|
|
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()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|