MHZ19 Namespace Reference
Classes | |
class | PwmReader |
Reads input pulse width asynchronously. More... | |
struct | Request |
struct | Response |
struct | Measurement |
class | Uart |
Access MHZ19 sensor via serial port. More... | |
Typedefs | |
using | MeasurementCallback = Delegate< void(Measurement &m)> |
Enumerations | |
enum class | DetectionRange { PPM_2000 = 2000 , PPM_5000 = 5000 , PPM_10000 = 10000 } |
Device may be configured to output CO2 PPM values in various ranges. More... | |
enum | Command { CMD_GasConcentration = 0x86 , CMD_CalibrateZeroPoint = 0x87 , CMD_CalibrateSpanPoint = 0x88 , CMD_SelfCalbrationOnOff = 0x79 , CMD_SetDetectionRange = 0x99 } |
Available commands. More... | |
enum class | Error { success , incompleteResponse , invalidResponse , timeout } |
Functions | |
unsigned | pwmRead (uint8_t pwmPin, DetectionRange range) |
Read PWM output from sensor. More... | |
Typedef Documentation
◆ MeasurementCallback
using MHZ19::MeasurementCallback = typedef Delegate<void(Measurement& m)> |
Enumeration Type Documentation
◆ Command
enum MHZ19::Command |
◆ DetectionRange
|
strong |
◆ Error
|
strong |
Function Documentation
◆ pwmRead()
unsigned MHZ19::pwmRead | ( | uint8_t | pwmPin, |
DetectionRange | range | ||
) |
Read PWM output from sensor.
- Parameters
-
pwmPin GPIO to which the sensor is connected range Range sensor is configured for
- Note
- This will hang CPU for 1-2 seconds. Use PwmReader instead.