envirophat

package
v0.0.0-...-a97f0ba Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2017 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (

	//	Configuration register bits
	CTRL_REG0 = 0x1F
	CTRL_REG1 = 0x20
	CTRL_REG2 = 0x21
	CTRL_REG3 = 0x22
	CTRL_REG4 = 0x23
	CTRL_REG5 = 0x24
	CTRL_REG6 = 0x25
	CTRL_REG7 = 0x26

	//	Acceleromter outputs:
	OUT_X_L_A = 0x28
	OUT_X_H_A = 0x29
	OUT_Y_L_A = 0x2A
	OUT_Y_H_A = 0x2B
	OUT_Z_L_A = 0x2C
	OUT_Z_H_A = 0x2D

	//	Accelerometer scale
	ACCEL_SCALE = 2 // +/- 2gs
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Envirophat

type Envirophat struct {
	Bus embd.I2CBus
}

Envirophat represents a Pimoroni enviro-phat with multiple sensor types.

func New

func New(bus embd.I2CBus) *Envirophat

New returns a handle to a Envirophat object.

func (*Envirophat) Accelerometer

func (d *Envirophat) Accelerometer() (x float64, y float64, z float64, err error)

Accelerometer returns the current accelerometer vector

Jump to

Keyboard shortcuts

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