#include <src/sensors/TallyCounterI2C.h>
TallyCounterI2C
class
The Sensor sub-class for the Tally Counter I2C.
- Reference
- Detailed Descriptions
Base classes
- class Sensor
- The "Sensor" class is used for all sensor-level operations - waking, sleeping, and taking measurements.
Constructors, destructors, conversion operators
- TallyCounterI2C(int8_t powerPin = -1, uint8_t i2cAddressHex = 0x33)
- Construct a new Tally Counter I2C object using the primary hardware I2C instance.
- ~TallyCounterI2C()
- Destroy the Tally Counter object.
Public functions
- bool setup(void) -> bool override
- Do any one-time preparations needed before the sensor will be able to take readings.
- String getSensorLocation(void) -> String override
- Get the pin or connection location between the mcu and the sensor.
- bool addSingleMeasurementResult(void) -> bool override
- Get the results from a single measurement.
Function documentation
TallyCounterI2C:: TallyCounterI2C(int8_t powerPin = -1,
uint8_t i2cAddressHex = 0x33)
Construct a new Tally Counter I2C object using the primary hardware I2C instance.
Parameters | |
---|---|
powerPin | The pin on the mcu controlling power to TallyCounterI2C.
|
i2cAddressHex | The I2C address of the Tally Counter I2C is 0x33 by default. |
bool TallyCounterI2C:: setup(void) override
Do any one-time preparations needed before the sensor will be able to take readings.
Returns | bool True if the setup was successful. |
---|
This begins the Wire library (sets pin modes for I2C) and updates the _
String TallyCounterI2C:: getSensorLocation(void) override
Get the pin or connection location between the mcu and the sensor.
Returns | String Text describing how the sensor is attached to the mcu. |
---|
bool TallyCounterI2C:: addSingleMeasurementResult(void) override
Get the results from a single measurement.
Returns | bool True if the function completed successfully. |
---|
This asks the sensor for a new result, verifies that it passes sanity range checks, and then adds the value to the result array.
This also un-sets the _