minimu9

package module
Version: 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: 6 Imported by: 0

README

minimu9

MinIMU-9 (https://www.pololu.com/product/2468) sensor pack drivers

GoDoc License Build Status Coverage Status

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Heading

func Heading(a, m, g r3.Vector) r3.Vector

func ReadStatusAndVector

func ReadStatusAndVector(bus i2c.Bus, addr, reg byte) (
	v r3.Vector, e error)

ReadStatusAndVector reads status byte, and 3x2-byte X, Y and Z int16 vector values.

func WriteBitsToReg

func WriteBitsToReg(bus i2c.Bus, address, reg, mask, value byte) error

WriteBitsToReg reads a byte from a specified address, clears the bits set in mask, then sets them to a specified value and writes back.

func WriteVector

func WriteVector(bus i2c.Bus, addr, reg byte, v IntVector) error

WriteVector writes IntVector dimensions.

Types

type DataAvailabilityError

type DataAvailabilityError struct {
	NewDataNotAvailable   bool
	NewDataWasOverwritten bool
}

DataAvailabilityError is a warning which tells that some data was either lost (not read by the user before it was overwritten with a new value), or not available yet (the measurement frequency is too low).

func (*DataAvailabilityError) Error

func (e *DataAvailabilityError) Error() string

Error returns human-readable description string for the error.

type IntVector

type IntVector struct {
	X, Y, Z int16
}

IntVector is a 3D vector holding the dimensions in 2-byte signed integers, as all the hardware parts of miniIMU9 do.

func GetOffsetAndRange

func GetOffsetAndRange(read func() (IntVector, error), stop chan int) (
	IntVector, r3.Vector, error)

GetOffsetAndRange computes average offset and range of vectors returned by read(), until stop channel is written to.

func ReadVector

func ReadVector(bus i2c.Bus, addr, reg byte) (v IntVector, e error)

ReadVector reads IntVector dimensions.

func (*IntVector) R3

func (v *IntVector) R3() r3.Vector

R3 converts IntVector into r3.Vector.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL