sgp30

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2021 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InitAirQuality       uint16 = 0x2003
	MeasureAirQuality    uint16 = 0x2008
	GetIAQBaseline       uint16 = 0x2015
	SetIAQBaseline       uint16 = 0x201e
	SetHumidity          uint16 = 0x2061
	MeasureTest          uint16 = 0x2032
	GetFeatureSetVersion uint16 = 0x202f
	MeasureRawSignals    uint16 = 0x2050
	GetTVOCBaseline      uint16 = 0x20b3
	SetTVOCBaseline      uint16 = 0x2077

	I2CAddress uint16 = 0x58
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CO2

type CO2 uint16

CO2 represents the current carbon dioxide value in ppm

func (*CO2) Set

func (c *CO2) Set(b []byte)

func (CO2) String

func (c CO2) String() string

type Dev

type Dev struct {
	// contains filtered or unexported fields
}

Dev is a handle to an initialized SGP30 device.

func NewI2C

func NewI2C(b i2c.Bus, addr uint16) (*Dev, error)

NewI2C returns an object that communicates over I2C to SGP30 environmental sensor.

The address must be 0x58.

func (*Dev) EquivalentCO2

func (d *Dev) EquivalentCO2() CO2

EquivalentCO2 returns the latest equivalent CO2 value

func (*Dev) TotalVOC

func (d *Dev) TotalVOC() TVOC

TotalVOC returns the latest total VOC value

type Env

type Env struct {
	CO2  CO2
	TVOC TVOC
}

Env represents measurements from an environmental sensor.

type TVOC

type TVOC uint16

TVOC represents the current total volatile organic compounds value in ppb

func (*TVOC) Set

func (t *TVOC) Set(b []byte)

func (TVOC) String

func (t TVOC) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL