shtc3

package
v0.0.0-...-2e22e3b Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package shtc3 provides a driver for the SHTC3 digital humidity sensor series by Sensirion.

Datasheet: https://www.sensirion.com/fileadmin/user_upload/customers/sensirion/Dokumente/2_Humidity_Sensors/Datasheets/Sensirion_Humidity_Sensors_SHTC3_Datasheet.pdf

Index

Constants

View Source
const (
	SHTC3_ADDRESS        = 0x70
	SHTC3_CMD_WAKEUP     = "\x35\x17" // Wake up
	SHTC3_CMD_MEASURE_HP = "\x7C\xA2" // Read sensor in high power mode with clock stretching
	SHTC3_CMD_SLEEP      = "\xB0\x98" // Sleep
	SHTC3_CMD_SOFT_RESET = "\x80\x5D" // Soft Reset
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Device

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

Device wraps an I2C connection to a SHT31 device.

func New

func New(bus drivers.I2C) Device

New creates a new SHTC3 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.

func (*Device) Sleep

func (d *Device) Sleep() error

Sleep makes device go to sleep

func (*Device) WakeUp

func (d *Device) WakeUp() error

WakeUp makes device leave sleep mode

Jump to

Keyboard shortcuts

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