v0.0.0-...-91dc0f5 Latest Latest

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

Go to latest
Published: Apr 9, 2015 License: MIT Imports: 6 Imported by: 0



Package l3gd20 allows interacting with L3GD20 gyroscoping sensor.



This section is empty.


View Source
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.


This section is empty.


type L3GD20

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

L3GD20 represents a L3GD20 3-axis gyroscope.

func New

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

func (d *L3GD20) Close() error


func (*L3GD20) OrientationDelta

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

Orientation returns the current orientation reading.

func (*L3GD20) Orientations

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

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

func (*L3GD20) Start

func (d *L3GD20) Start() error

Start starts the data acquisition loop.

func (*L3GD20) Stop

func (d *L3GD20) Stop() error

Stop the data acquisition loop.

func (*L3GD20) Temperature

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

Temperature returns the current temperature reading.

type Orientation

type Orientation struct {
	X, Y, Z float64

type Range

type Range struct {
	// contains filtered or unexported fields

Range represents a L3GD20 range setting.

Jump to

Keyboard shortcuts

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