GY-63_MS5611/libraries/MAX31855_RT/examples/max31855_demo1/max31855_demo1.ino

54 lines
817 B
Arduino
Raw Normal View History

2021-01-29 06:31:58 -05:00
//
// FILE: max31855_demo1.ino
// AUTHOR: Rob Tillaart
2021-12-09 14:42:42 -05:00
// VERSION: 0.4.0
2021-01-29 06:31:58 -05:00
// PURPOSE: thermocouple lib demo application
// DATE: 2014-01-02
// 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
2021-01-29 06:31:58 -05:00
const int doPin = 7;
const int csPin = 6;
const int clPin = 5;
2021-12-09 14:42:42 -05:00
MAX31855 tc;
2021-01-29 06:31:58 -05:00
void setup()
{
Serial.begin(115200);
Serial.print("Start max31855_demo1: ");
Serial.println(MAX31855_VERSION);
Serial.println();
2021-12-09 14:42:42 -05:00
tc.begin(clPin, csPin, doPin);
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()
{
int status = tc.read();
if (status != 0)
{
Serial.print("stat:\t\t");
Serial.println(status);
}
float temp = tc.getTemperature();
int m = temp * 10 - 200;
Serial.print(temp);
Serial.print('\t');
for (int i = 0; i < m; i++) Serial.write(']');
Serial.println();
}
2021-12-09 14:42:42 -05:00
2021-01-29 06:31:58 -05:00
// -- END OF FILE --
2021-12-09 14:42:42 -05:00