bmp180

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2017 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package bmp180 controls a Bosch BMP180 device over I²C.

Datasheet

The official data sheet can be found here:

https://ae-bst.resource.bosch.com/media/_tech/media/datasheets/BST-BMP180-DS000-121.pdf

The font the official datasheet on page 15 is unreadable, a copy with readable text can be found here:

https://cdn-shop.adafruit.com/datasheets/BST-BMP180-DS000-09.pdf

Notes on the datasheet

The results of the calculations in the algorithm on page 15 are partly wrong. It looks like the original authors used non-integer calculations and some nubers were rounded. Take the results of the calculations with a grain of salt.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dev

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

Dev is a handle to a bmp180.

func New

func New(b i2c.Bus, os Oversampling) (d *Dev, err error)

New returns an object that communicates over I²C to BMP180 environmental sensor. The frequency for the bus can be up to 3.4MHz.

func (*Dev) Halt

func (d *Dev) Halt() error

Halt is a noop for the BMP180.

func (*Dev) Reset

func (d *Dev) Reset() error

Reset issues a soft reset to the device.

func (*Dev) Sense

func (d *Dev) Sense(env *devices.Environment) error

Sense returns measurements as °C and kPa.

func (*Dev) String

func (d *Dev) String() string

type Oversampling

type Oversampling uint8

Oversampling affects how much time is taken to measure pressure.

const (
	// Possible oversampling values
	No  Oversampling = 0
	O2x Oversampling = 1
	O4x Oversampling = 2
	O8x Oversampling = 3
)

Jump to

Keyboard shortcuts

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