MHZ19 Namespace Reference

Classes

struct  Measurement
 
class  PwmReader
 Reads input pulse width asynchronously. More...
 
struct  Request
 
struct  Response
 
class  Uart
 Access MHZ19 sensor via serial port. More...
 

Typedefs

using MeasurementCallback = Delegate< void(Measurement &m)>
 

Enumerations

enum  DetectionRange { DetectionRange::PPM_2000 = 2000, DetectionRange::PPM_5000 = 5000, DetectionRange::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  Error { Error::success, Error::incompleteResponse, Error::invalidResponse, Error::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

Available commands.

Support differs by device variant

Enumerator
CMD_GasConcentration 

-, B, C

CMD_CalibrateZeroPoint 

-, B

CMD_CalibrateSpanPoint 

-, B

CMD_SelfCalbrationOnOff 

B, C.

CMD_SetDetectionRange 

B.

◆ DetectionRange

enum MHZ19::DetectionRange
strong

Device may be configured to output CO2 PPM values in various ranges.

Enumerator
PPM_2000 
PPM_5000 
PPM_10000 

◆ Error

enum MHZ19::Error
strong
Enumerator
success 
incompleteResponse 
invalidResponse 
timeout 

Function Documentation

◆ pwmRead()

unsigned MHZ19::pwmRead ( uint8_t  pwmPin,
DetectionRange  range 
)

Read PWM output from sensor.

Parameters
pwmPinGPIO to which the sensor is connected
rangeRange sensor is configured for
Note
This will hang CPU for 1-2 seconds. Use PwmReader instead.