l3gd

package
v0.0.0-...-8d478b1 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2016 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultAddress = 0x6b

DefaultAddress is a default I2C address for this sensor.

Variables

This section is empty.

Functions

This section is empty.

Types

type Gyro

type Gyro struct {
	Offset r3.Vector
	// contains filtered or unexported fields
}

Gyro is a sensor driver implementation for L3GD20H Gyro. Documentation: http://goo.gl/Nb95rx Arduino code samples: https://github.com/pololu/l3g-arduino

func NewGyro

func NewGyro(bus i2c.Bus, addr byte) *Gyro

NewGyro creates new instance bound to I2C bus and address.

func (*Gyro) Calibrate

func (g *Gyro) Calibrate(stop chan int) error

Calibrate measures gyro offset until stop channel is written to. Gyro offset is then saved to Offset field. NOTE: during calibration, the sensor has to be static (not moving).

func (*Gyro) Read

func (g *Gyro) Read() (r3.Vector, error)

Read reads angular speed data from the sensor, in degrees per second. Note: err might be a warning about data "freshness" if it's minimu9.DataAvailabilityError.

func (*Gyro) SetFrequency

func (g *Gyro) SetFrequency(value float64) error

SetFrequency sets gyro output data rate, in Hz. Values: 12.5 .. 800.

func (*Gyro) SetFullScale

func (g *Gyro) SetFullScale(value float64) error

SetFullScale sets gyro full scale, which affects sensitivity. Values: 245, 500, 2000 (degrees/s)

func (*Gyro) Sleep

func (g *Gyro) Sleep() error

Sleep puts the sensor in low power consumption mode.

func (*Gyro) Wake

func (g *Gyro) Wake() error

Wake enables sensor if it was put into power-down mode with Sleep().

Jump to

Keyboard shortcuts

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