scd30

package
v0.0.0-...-adaef5b Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2021 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFailedChecksum = fmt.Errorf("failed checksum")
	ErrNaN            = fmt.Errorf("invalid reading")
)

Functions

This section is empty.

Types

type Driver

type Driver struct {
	i2c.Config
	// contains filtered or unexported fields
}

A Driver for the SCD-30 CO2, Temperature, and Humidity sensor.

func NewDriver

func NewDriver(c i2c.Connector, options ...func(i2c.Config)) *Driver

func (*Driver) Connection

func (d *Driver) Connection() gobot.Connection

func (*Driver) GetFirmwareVersion

func (d *Driver) GetFirmwareVersion() (uint16, error)

func (*Driver) GetLevels

func (d *Driver) GetLevels() (reading Reading, err error)

func (*Driver) Halt

func (d *Driver) Halt() (err error)

func (*Driver) Name

func (d *Driver) Name() string

func (*Driver) Reset

func (d *Driver) Reset() (err error)

func (*Driver) SetMeasurementInterval

func (d *Driver) SetMeasurementInterval(interval time.Duration) error

func (*Driver) SetName

func (d *Driver) SetName(n string)

func (*Driver) Start

func (d *Driver) Start() (err error)

func (*Driver) StartContinuousMeasurement

func (d *Driver) StartContinuousMeasurement() error

type Reading

type Reading struct {
	CO2  float64 // Carbon dioxide concentration, ppm
	Temp float64 // Temperature, Celsius
	Hum  float64 // Humidity, relative %
}

Jump to

Keyboard shortcuts

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