Loom_TSL2561 class

TSL2561 Luminosity sensor module.

Base classes

class LoomI2CSensor
Abstract root for I2C sensor modules.

Protected variables

Adafruit_TSL2561_Unified inst_TSL2561
Underlying TSL2561 sensor manager instance.
uint8_t gain
Gain level.
uint8_t resolution
Sensor resolution setting.
uint16_t lightIR
Measured infra-red. Units: lux.
uint16_t lightFull
Measure full spectrum. Units: lux.

CONSTRUCTORS / DESTRUCTOR

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

OPERATION

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

Function documentation

Loom_TSL2561::Loom_TSL2561(LoomManager* manager, const byte i2c_address = 0x39, const uint8_t mux_port = 255, const uint8_t gain = 1, const uint8_t resolution = 3)

Constructor.

Parameters
manager
i2c_address in Set(Int) | <0x39> | {0x29, 0x39, 0x49} | I2C address
mux_port in Int | <255> | [0-16] | Port on multiplexer
gain in Set(Int) | <1> | {1, 16} | Gain level
resolution in Set(Int) | <3> | { 1("Low"), 2("Med"), 3("High") } | Resolution

Loom_TSL2561::Loom_TSL2561(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_TSL2561::package(JsonObject json) override

Package a modules measurements or state.

Parameters
json out Object to put data into

void Loom_TSL2561::print_measurements() const override

Print the last set of measurements taken.

Does not package the data.