si70xx

package
v0.0.0-...-ab041b8 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package si70xx is a driver for the Si70xx temperature / humidity sensor

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Si70xx

type Si70xx struct {
	// Bus to communicate over.
	Bus embd.I2CBus
	// contains filtered or unexported fields
}

Si70xx represents The Si70xx sensor (Si7013, Si7020, or Si7021)

func New

func New(bus embd.I2CBus) *Si70xx

New creates a new si70xx sensor.

func (*Si70xx) Close

func (d *Si70xx) Close() error

Close stops any period reads in progress. Call this to stop the readings that Start() begins

func (*Si70xx) FirmwareVersion

func (d *Si70xx) FirmwareVersion() (string, error)

FirmwareVersion returns the sensor's firmware version

func (*Si70xx) Humidity

func (d *Si70xx) Humidity() (float32, error)

Humdity performs a Relative Humidity reading

func (*Si70xx) IsPresent

func (d *Si70xx) IsPresent() bool

IsPresent returns true if it looks like we were able to see the sensor

func (*Si70xx) LastTemperature

func (d *Si70xx) LastTemperature() (float32, error)

LastTemperature returns a temperature value that was measured during the last Humidity reading, without waiting for the sensor to perform a new reading.

func (*Si70xx) ModelName

func (d *Si70xx) ModelName() (string, error)

ModelName returns the model name of the sensor (Si7013, Si7020, or Si7021)

func (*Si70xx) Readings

func (d *Si70xx) Readings() <-chan *core.TemperatureAndHumidityReading

Readings is a channel that will contain sensor readings after calling Start()

func (*Si70xx) SerialNumber

func (d *Si70xx) SerialNumber() (string, error)

SerialNumber returns the sensor's hardware serial number

func (*Si70xx) Start

func (d *Si70xx) Start(rate core.DataRate) error

Start produces a stream of humidity and temperature readings in the Readings() channel

func (*Si70xx) Temperature

func (d *Si70xx) Temperature() (float32, error)

Temperature performs a Temperature reading

Jump to

Keyboard shortcuts

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