#include <src/sensors/AlphasenseCO2.h>
AlphasenseCO2
class
The Sensor sub-class for the [Alphasense IRC-A1 CO2](Alphasense IRC-A1 CO2) sensor.
- 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
-
AlphasenseCO2(int8_t powerPin,
aco2_
adsDiffMux_ t adsDiffMux = DIFF_ MUX_ 2_ 3, uint8_t i2cAddress = 0x48, uint8_t measurementsToAverage = 7) - Construct a new Alphasense IRC-A1 CO2 object - need the power pin and the on the ADS1x15. Designed to read differential voltage between ads channels 2 and 3.
- ~AlphasenseCO2()
- Destroy the AlphasenseCO2 object - no action needed.
Public functions
- String getSensorLocation(void) -> String override
- Report the I1C address of the ADS and the channel that the Alphasense CO2 sensor is attached to.
- bool addSingleMeasurementResult(void) -> bool override
- Get the results from a single measurement.
Function documentation
AlphasenseCO2:: AlphasenseCO2(int8_t powerPin,
aco2_ adsDiffMux_ t adsDiffMux = DIFF_ MUX_ 2_ 3,
uint8_t i2cAddress = 0x48,
uint8_t measurementsToAverage = 7)
Construct a new Alphasense IRC-A1 CO2 object - need the power pin and the on the ADS1x15. Designed to read differential voltage between ads channels 2 and 3.
Parameters | |
---|---|
powerPin | The pin on the mcu controlling power to the Alphasense CO2 sensor. Use -1 if it is continuously powered.
|
adsDiffMux | Which two pins on the TI ADS1115 that will measure differential voltage. See aco2_ |
i2cAddress | The I2C address of the ADS 1x15, default is 0x48 (ADDR = GND) |
measurementsToAverage | The number of measurements to take and average before giving a "final" result from the sensor; optional with a default value of 7 [seconds], which is one period of the cycle. |
String AlphasenseCO2:: getSensorLocation(void) override
Report the I1C address of the ADS and the channel that the Alphasense CO2 sensor is attached to.
Returns | String String Text describing how the sensor is attached to the mcu. |
---|
bool AlphasenseCO2:: 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 _