LoomI2CSensor class

Abstract root for I2C sensor modules.

Base classes

class LoomSensor
Abstract root of Loom sensor modules hierarchy.

Derived classes

class Loom_ADS1115
ADS1115 External ADC sensor module.
class Loom_AS7262
AS7262 Visible spectrum spectral sensor module.
class Loom_AS7263
AS7263 Near Infrared spectrum spectral sensor module.
class Loom_AS7265X
AS72625X 3 Spectrum (Visible, near IR, UV) spectral sensor module.
class Loom_FXAS21002
FXAS21002 3-Axis Gyroscope sensor module.
class Loom_FXOS8700
FXOS8700 3-Axis Acceleromter/Magnetometer sensor module.
class Loom_LIS3DH
LIS3DH Accelerometer sensor module.
class Loom_MB1232
MB1232 Sonar sensor module.
class Loom_MMA8451
MMA8451 accelerometer sensor module.
class Loom_MPU6050
MPU6050 6 axis gyroscope and accelerometer sensor module.
class Loom_MS5803
MS5803 Atmospheric Pressure / Temperature sensor module.
class Loom_SHT31D
SHT31D Temperature / Humidty sensor module.
class Loom_STEMMA
Adafruit Stemma soil moisture sensor.
class Loom_TMP007
TMP007 thermopile temperature sensor module.
class Loom_TSL2561
TSL2561 Luminosity sensor module.
class Loom_TSL2591
TSL2591 Lux sensor module.
class Loom_ZXGesture
ZXGesture position / gesture sensor module.

Protected variables

const byte i2c_address
The sensor's I2C address.
const uint8_t port_num
Used with multiplexer, keep track of port it is on.

CONSTRUCTORS / DESTRUCTOR

LoomI2CSensor(LoomManager* manager, const char* module_name, const LoomModule::Type module_type, const byte i2c_address, const uint8_t mux_port = 255, const uint8_t num_samples = 1)
Constructor.
~LoomI2CSensor() defaulted virtual
Destructor.

GETTERS

auto get_i2c_address() const -> byte
Get the sensor's I2C address.

Function documentation

LoomI2CSensor::LoomI2CSensor(LoomManager* manager, const char* module_name, const LoomModule::Type module_type, const byte i2c_address, const uint8_t mux_port = 255, const uint8_t num_samples = 1)

Constructor.

Parameters
manager
module_name in Name of the module (provided by derived classes)
module_type in Type of the module (provided by derived classes)
i2c_address in The i2c address of the sensor
mux_port
num_samples in The number of samples to take and average

byte LoomI2CSensor::get_i2c_address() const

Get the sensor's I2C address.

Returns The sensor's I2C address

Variable documentation

const byte LoomI2CSensor::i2c_address protected

The sensor's I2C address.

If the sensor supports mutliple, make sure this matches the current configuration of the i2c address