Documentation
¶
Index ¶
Constants ¶
View Source
const BaudRate = 9600
BaudRate is the UART baud rate of the sensor
Variables ¶
This section is empty.
Functions ¶
func CreateSerialConfig ¶
CreateSerialConfig creates a serial configuration with the baud rate of mh-z19
func SpanPointCalibration ¶
SpanPointCalibration sends a span point calibration command to the sensor with a reference CO2 concentration
func TakeReading ¶
func TakeReading(i io.ReadWriter) (uint16, error)
TakeReading takes a reading from the sensor
func ZeroPointCalibration ¶
ZeroPointCalibration sends a zero calibration command to the sensor
Types ¶
type Command ¶
type Command byte
Command is a command sent to the sensor
const ( // CmdGetReading takes a reading CmdGetReading Command = 0x86 // CmdZeroPointCalibration performs a zero point calibration CmdZeroPointCalibration Command = 0x87 // CmdSpanPointCalibration performs a span point calibration CmdSpanPointCalibration Command = 0x88 // CmdAutomaticBaselineCalibration enables or disables automatic calibration CmdAutomaticBaselineCalibration Command = 0x79 )
Click to show internal directories.
Click to hide internal directories.