sht3x

package
v0.0.0-...-3bb5b45 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2019 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package sht3x provides a driver for the SHT3x digital humidity sensor series by Sensirion.

Datasheet: https://www.sensirion.com/fileadmin/user_upload/customers/sensirion/Dokumente/0_Datasheets/Humidity/Sensirion_Humidity_Sensors_SHT3x_Datasheet_digital.pdf

Index

Constants

View Source
const (
	AddressA = 0x44
	AddressB = 0x45
)

The I2C address which this device listens to.

View Source
const (
	// single shot, high repeatability
	MEASUREMENT_COMMAND_MSB = 0x24
	MEASUREMENT_COMMAND_LSB = 0x00
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Device

type Device struct {
	Address uint16
	// contains filtered or unexported fields
}

Device wraps an I2C connection to a SHT31 device.

func New

func New(bus machine.I2C) Device

New creates a new SHT31 connection. The I2C bus must already be configured.

This function only creates the Device object, it does not initialize the device. You must call Configure() first in order to use the device itself.

func (*Device) ReadHumidity

func (d *Device) ReadHumidity() (relativeHumidity int16, err error)

Read returns the relative humidity in hundredths of a percent.

func (*Device) ReadTemperature

func (d *Device) ReadTemperature() (tempMilliCelsius int32, err error)

Read returns the temperature in celsius milli degrees (ºC/1000).

func (*Device) ReadTemperatureHumidity

func (d *Device) ReadTemperatureHumidity() (tempMilliCelsius int32, relativeHumidity int16, err error)

Read returns both the temperature and relative humidity.

Jump to

Keyboard shortcuts

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