Categorygithub.com/go-sensors/cubicpm1003
modulepackage
0.0.0-20220606014006-5713c1588535
Repository: https://github.com/go-sensors/cubicpm1003.git
Documentation: pkg.go.dev

# README

go-sensors/cubicpm1003

Go library for interacting with the Cubic PM1003 particulate matter sensor for measuring indoor air quality.

Quickstart

Take a look at rpi-sensor-exporter for an example implementation that makes use of this sensor (and others).

Sensor Details

The Cubic PM1003 particulate matter sensor is primarily used for measuring indoor air quality, per vendor specifications. This go-sensors implementation makes use of the sensor's UART-based protocol for obtaining PM2.5 measurements on a 1-second interval.

Building

This software doesn't have any compiled assets.

Code of Conduct

We are committed to fostering an open and welcoming environment. Please read our code of conduct before participating in or contributing to this project.

Contributing

We welcome contributions and collaboration on this project. Please read our contributor's guide to understand how best to work with us.

License and Authors

Daniel James logo Daniel James

license GitHub contributors

This software is made available by Daniel James under the MIT license.

# Functions

GetDefaultSerialPortConfig gets the manufacturer-specified defaults for connecting to the sensor.
NewSensor creates a Sensor with optional configuration.
WithMeasurementInterval specifies the duration to wait between reading measurements.
WithReconnectTimeout specifies the duration to wait before reconnecting after a recoverable error.
WithRecoverableErrorHandler registers a function that will be called when a recoverable error occurs.

# Constants

No description provided by the author
No description provided by the author
No description provided by the author

# Variables

Header of a valid measurement.
Command to write to the sensor to invoke its measurement routine.

# Structs

Option is a configured option that may be applied to a Sensor.
Sensor represents a configured Cubic PM1003 particulate matter sensor.

# Type aliases

ShouldTerminate is a function that returns a result indicating whether the Sensor should terminate after a recoverable error.