mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-22 10:42:49 +00:00
17 lines
500 B
C
17 lines
500 B
C
|
|
#include "../mesh/generated/environmental_measurement.pb.h"
|
||
|
|
#include "EnvironmentalMeasurementSensor.h"
|
||
|
|
#include <DS18B20.h>
|
||
|
|
#include <OneWire.h>
|
||
|
|
|
||
|
|
#define DS18B20_SENSOR_MINIMUM_WAIT_TIME_BETWEEN_READS 1000
|
||
|
|
|
||
|
|
class DallasSensor : virtual public EnvironmentalMeasurementSensor {
|
||
|
|
private:
|
||
|
|
OneWire *oneWire = NULL;
|
||
|
|
DS18B20 *ds18b20 = NULL;
|
||
|
|
|
||
|
|
public:
|
||
|
|
DallasSensor();
|
||
|
|
virtual int32_t runOnce() override;
|
||
|
|
virtual bool getMeasurement(EnvironmentalMeasurement *measurement) override;
|
||
|
|
};
|