LoomSensor class

Abstract root of Loom sensor modules hierarchy.

Base classes

class LoomModule
Abstract root of Loom component modules inheritance hierarchy.

Derived classes

class Loom_Analog
Analog pin manager module.
class Loom_Digital
Digital pin manager module.
class LoomI2CSensor
Abstract root for I2C sensor modules.
class LoomSDI12Sensor
Abstract base class for SDI12 sensor modules.
class LoomSerialSensor
Abstract root for Serial/UART sensor modules.
class LoomSPISensor
Abstract base class for SPI sensor modules.

Protected variables

uint8_t num_samples
How many samples to take and average each call to measure()

CONSTRUCTORS / DESTRUCTOR

LoomSensor(LoomManager* manager, const char* module_name, const LoomModule::Type module_type, const uint8_t num_samples)
Constructor.
~LoomSensor() defaulted virtual
Destructor.

OPERATION

void calibrate() virtual
Calibration routine.
void measure() pure virtual
Take any relevant measurements.

GETTERS

auto get_num_samples() const -> uint8_t
Get the number of samples sensor is set to take.

SETTERS

void set_num_samples(const uint8_t n)
Set the number of samples to take.

Function documentation

LoomSensor::LoomSensor(LoomManager* manager, const char* module_name, const LoomModule::Type module_type, const uint8_t num_samples)

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)
num_samples in The number of samples to take and average

void LoomSensor::print_measurements() const pure virtual

Print the last set of measurements taken.

Does not package the data.

uint8_t LoomSensor::get_num_samples() const

Get the number of samples sensor is set to take.

Returns Number of samples

void LoomSensor::set_num_samples(const uint8_t n)

Set the number of samples to take.

Parameters
in Number of samples to take