Loom_SHT31D class

SHT31D Temperature / Humidty sensor module.

Base classes

class LoomI2CSensor
Abstract root for I2C sensor modules.

Protected variables

Adafruit_SHT31 inst_sht31d
Underlying SHT31D sensor manager instance.
float temp
Measured temperature. Units: C.
float humid
Measured humidity Units: %.

CONSTRUCTORS / DESTRUCTOR

Loom_SHT31D(LoomManager* manager, const byte i2c_address = 0x44, const uint8_t mux_port = 255)
Constructor.
Loom_SHT31D(LoomManager* manager, JsonArrayConst p)
Constructor that takes Json Array, extracts args and delegates to regular constructor.
~Loom_SHT31D() defaulted
Destructor.

OPERATION

void measure() override
Take any relevant measurements.
void package(JsonObject json) override
Package a modules measurements or state.

GETTERS

auto get_temperature() const -> float
Get the temperature reading.

Function documentation

Loom_SHT31D::Loom_SHT31D(LoomManager* manager, const byte i2c_address = 0x44, const uint8_t mux_port = 255)

Constructor.

Parameters
manager
i2c_address in Set(Int) | <0x44> | {0x44, 0x45} | I2C address
mux_port in Int | <255> | [0-16] | Port on multiplexer

Loom_SHT31D::Loom_SHT31D(LoomManager* manager, JsonArrayConst p)

Constructor that takes Json Array, extracts args and delegates to regular constructor.

Parameters
manager
in The array of constuctor args to expand

void Loom_SHT31D::package(JsonObject json) override

Package a modules measurements or state.

Parameters
json out Object to put data into

void Loom_SHT31D::print_measurements() const override

Print the last set of measurements taken.

Does not package the data.

float Loom_SHT31D::get_temperature() const

Get the temperature reading.

Returns The measured temperature

Used by the LoomTempSync module to provide temperature to other modules.