Skip to content

readProbe()

Arnd edited this page Dec 12, 2020 · 4 revisions

probeTemperature = readProbe();


This function returns a signed 32 bit integer which represents the probe temperature in milli-degrees Celsius. To get degrees Celsius just divide by 1000, e.g. a temperature value of "31530" represents 31.53°C. This is done so that floating point calculations can be avoided while still keeping the device's precision. If the probe has an error the value returned will be INT32_MAX and the fault code can be read using fault().


Example:

#include <MAX31855.h> // MAX31855 Thermocouple Library
...
const uint8_t CS_PIN = 2;
MAX31855_Class device;
...
device.begin();
int32_t probeTemperature = device.readProbe();
if (probeTemperature==INT32_MAX) {
  Serial.print("Probe has error ");
  Serial.println(device.fault());
} else {
  Serial.print("Probe temperature is ");
  Serial.print(probeTemperature/1000.0,3);  // use floating point division
  Serial.println("\xC2\xB0""C"); // Display degree symbol
} // of if-then-else fault
...    

Overview

Overview
Installation
Class Instantiation

Public Functions

begin()
readProbe()
readAmbient()
fault()

Public Variables

-none-

Example Program

Demo.ino

Clone this wiki locally