mirror of
https://github.com/RobTillaart/Arduino.git
synced 2024-10-03 18:09:02 -04:00
48 lines
756 B
Arduino
48 lines
756 B
Arduino
|
//
|
||
|
// FILE: MAX31850_minimum.ino
|
||
|
// AUTHOR: Rob Tillaart
|
||
|
// PURPOSE: minimal sketch
|
||
|
|
||
|
|
||
|
#include "OneWire.h"
|
||
|
#include "MAX31850.h"
|
||
|
|
||
|
|
||
|
#define ONE_WIRE_BUS 2
|
||
|
|
||
|
|
||
|
OneWire oneWire(ONE_WIRE_BUS);
|
||
|
MAX31850 sensor(&oneWire);
|
||
|
|
||
|
|
||
|
void setup(void)
|
||
|
{
|
||
|
Serial.begin(115200);
|
||
|
Serial.println();
|
||
|
Serial.println(__FILE__);
|
||
|
Serial.print("MAX31850_LIB_VERSION: ");
|
||
|
Serial.println(MAX31850_LIB_VERSION);
|
||
|
|
||
|
sensor.begin();
|
||
|
sensor.requestTemperatures();
|
||
|
}
|
||
|
|
||
|
|
||
|
void loop(void)
|
||
|
{
|
||
|
if (sensor.isConversionComplete())
|
||
|
{
|
||
|
sensor.read();
|
||
|
Serial.print("TC:\t");
|
||
|
Serial.println(sensor.getTempTC());
|
||
|
Serial.print("INTERN:\t");
|
||
|
Serial.println(sensor.getTempInternal());
|
||
|
Serial.println();
|
||
|
sensor.requestTemperatures();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
// -- END OF FILE --
|
||
|
|