GY-63_MS5611/libraries/DS18B20_INT/examples/DS18B20_minimum/DS18B20_minimum.ino
2021-12-17 11:26:25 +01:00

39 lines
640 B
C++

//
// FILE: DS18B20_minimum.ino
// AUTHOR: Rob Tillaart
// PURPOSE: most minimal sketch
//
// WARNING: this sketch does not wait for isConversionComplete()
// and therefore temperature read is probably incorrect
// but it is fast and maybe accurate enough...
#include <OneWire.h>
#include <DS18B20_INT.h>
#define ONE_WIRE_BUS 2
OneWire oneWire(ONE_WIRE_BUS);
DS18B20_INT sensor(&oneWire);
void setup(void)
{
Serial.begin(115200);
Serial.println(__FILE__);
sensor.begin();
}
void loop(void)
{
sensor.requestTemperatures();
Serial.println(sensor.getTempC());
}
// -- END OF FILE --