bme280

package
v0.0.0-...-5725b45 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2020 License: BSD-3-Clause Imports: 4 Imported by: 1

Documentation

Overview

Package bme280 provides access to BME280 devices.

Index

Constants

View Source
const (
	I2CAddr uint8 = 0x76 // BME280 default address
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Device

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

Device is a handle to a BME280 device

func Open

func Open(conn *smbus.Conn, addr uint8, mode OpMode) (*Device, error)

Open opens a connection to a BME280 device at the given address.

func (*Device) Close

func (dev *Device) Close() error

func (*Device) Sample

func (dev *Device) Sample() (h, p, t float64, err error)

Sample returns the (compensated) Humidity, Pressure and Temperature data off the device.

type OpMode

type OpMode uint8

OpMode describes the operating modes of a BME280 device.

const (
	OpInvalid OpMode = iota
	OpSample1
	OpSample2
	OpSample4
	OpSample8
	OpSample16
)

Operating modes

Jump to

Keyboard shortcuts

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