2021-01-29 06:31:58 -05:00
|
|
|
//
|
|
|
|
// FILE: max31855_demo0.ino
|
|
|
|
// AUTHOR: Rob Tillaart
|
|
|
|
// PURPOSE: thermocouple lib demo application
|
|
|
|
// DATE: 2014-01-01
|
|
|
|
// URL: https://github.com/RobTillaart/MAX31855_RT
|
|
|
|
//
|
|
|
|
|
2021-12-09 14:42:42 -05:00
|
|
|
|
2021-01-29 06:31:58 -05:00
|
|
|
#include "MAX31855.h"
|
|
|
|
|
2021-12-09 14:42:42 -05:00
|
|
|
|
2023-11-29 09:53:40 -05:00
|
|
|
const int selectPin = 7;
|
|
|
|
const int dataPin = 6;
|
|
|
|
const int clockPin = 5;
|
2021-01-29 06:31:58 -05:00
|
|
|
|
2023-11-29 09:53:40 -05:00
|
|
|
MAX31855 thermoCouple(selectPin, dataPin, clockPin);
|
2021-12-09 14:42:42 -05:00
|
|
|
|
2021-01-29 06:31:58 -05:00
|
|
|
|
|
|
|
void setup()
|
|
|
|
{
|
|
|
|
Serial.begin(115200);
|
2023-11-29 09:53:40 -05:00
|
|
|
Serial.println(__FILE__);
|
|
|
|
Serial.print("MAX31855_VERSION : ");
|
2021-01-29 06:31:58 -05:00
|
|
|
Serial.println(MAX31855_VERSION);
|
|
|
|
Serial.println();
|
2023-11-29 09:53:40 -05:00
|
|
|
delay(250);
|
2021-01-29 06:31:58 -05:00
|
|
|
|
2024-01-19 12:36:07 -05:00
|
|
|
SPI.begin();
|
|
|
|
|
2023-11-29 09:53:40 -05:00
|
|
|
thermoCouple.begin();
|
2021-01-29 06:31:58 -05:00
|
|
|
}
|
|
|
|
|
2021-12-09 14:42:42 -05:00
|
|
|
|
2021-01-29 06:31:58 -05:00
|
|
|
void loop()
|
|
|
|
{
|
2023-11-29 09:53:40 -05:00
|
|
|
int status = thermoCouple.read();
|
2021-01-29 06:31:58 -05:00
|
|
|
Serial.print("stat:\t\t");
|
|
|
|
Serial.println(status);
|
|
|
|
|
2023-11-29 09:53:40 -05:00
|
|
|
float internal = thermoCouple.getInternal();
|
2021-01-29 06:31:58 -05:00
|
|
|
Serial.print("internal:\t");
|
2021-07-05 02:37:20 -04:00
|
|
|
Serial.println(internal, 3);
|
2021-01-29 06:31:58 -05:00
|
|
|
|
2023-11-29 09:53:40 -05:00
|
|
|
float temp = thermoCouple.getTemperature();
|
2021-01-29 06:31:58 -05:00
|
|
|
Serial.print("temperature:\t");
|
2021-07-05 02:37:20 -04:00
|
|
|
Serial.println(temp, 3);
|
2021-01-29 06:31:58 -05:00
|
|
|
delay(1000);
|
|
|
|
}
|
2021-12-09 14:42:42 -05:00
|
|
|
|
|
|
|
|
2023-11-29 09:53:40 -05:00
|
|
|
// -- END OF FILE
|