120 if (!oneWire.reset())
127 for (
auto &buf_elem : buf)
129 buf_elem = oneWire.read();
132 if (!oneWire.reset())
136 if (oneWire.crc8(buf, 8) != buf[8])
143 int16_t result = (buf[1] << 8) | buf[0];
144 result = (result * 6) + (result >> 2);
159 static inline OneWire oneWire;
This class implements the temperature sensing feature.
constexpr TemperatureSensing()=delete
constexpr TemperatureSensing(uint8_t pin, const DeviceAddress(&ref)[N])
Construct a new Temperature Sensing object.
const DeviceAddress sensorAddrs[N]
constexpr auto get_size() const
Get the number of sensors.
int16_t readTemperature(const uint8_t idx)
Read temperature of a specific device.
void requestTemperatures()
Request temperature for all sensors.
constexpr auto get_pin() const
Get the pin of the sensor(s)
void initTemperatureSensors()
Initialize the Dallas sensors.
constexpr uint8_t CONVERT_TEMPERATURE
constexpr int16_t DEVICE_DISCONNECTED_RAW
constexpr uint8_t READ_SCRATCHPAD
constexpr int16_t OUTOFRANGE_TEMPERATURE
constexpr int16_t TEMP_RANGE_HIGH
Structure representing the address of a device.
constexpr bool TEMP_SENSOR_PRESENT