embd: github.com/kidoman/embd/sensor/l3gd20 Index | Files

package l3gd20

import "github.com/kidoman/embd/sensor/l3gd20"

Package l3gd20 allows interacting with L3GD20 gyroscoping sensor.

Index

Package Files

l3gd20.go

Variables

var (
    R250DPS  = &Range{sensitivity: 0.00875, value: 0x00}
    R500DPS  = &Range{sensitivity: 0.0175, value: 0x10}
    R2000DPS = &Range{sensitivity: 0.070, value: 0x20}
)

The three range settings supported by L3GD20.

type L3GD20 Uses

type L3GD20 struct {
    Bus   embd.I2CBus
    Range *Range
    // contains filtered or unexported fields
}

L3GD20 represents a L3GD20 3-axis gyroscope.

func New Uses

func New(bus embd.I2CBus, Range *Range) *L3GD20

New creates a new L3GD20 interface. The bus variable controls the I2C bus used to communicate with the device.

func (*L3GD20) Close Uses

func (d *L3GD20) Close() error

Close.

func (*L3GD20) OrientationDelta Uses

func (d *L3GD20) OrientationDelta() (float64, float64, float64, error)

Orientation returns the current orientation reading.

func (*L3GD20) Orientations Uses

func (d *L3GD20) Orientations() (<-chan Orientation, error)

Orientations returns a channel which will have the current temperature reading.

func (*L3GD20) Start Uses

func (d *L3GD20) Start() error

Start starts the data acquisition loop.

func (*L3GD20) Stop Uses

func (d *L3GD20) Stop() error

Stop the data acquisition loop.

func (*L3GD20) Temperature Uses

func (d *L3GD20) Temperature() (int, error)

Temperature returns the current temperature reading.

type Orientation Uses

type Orientation struct {
    X, Y, Z float64
}

type Range Uses

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

Range represents a L3GD20 range setting.

Package l3gd20 imports 6 packages (graph) and is imported by 2 packages. Updated 2016-07-19. Refresh now. Tools for package owners.