adxl345

package
v0.2.16 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2023 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

Package adxl345 implements the MovementSensor interface for the ADXL345 accelerometer attached to the I2C bus of the robot (the chip supports communicating over SPI as well, but this package does not support that interface). The manual for this chip is available at: https://www.analog.com/media/en/technical-documentation/data-sheets/adxl345.pdf

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAdxl345

func NewAdxl345(
	ctx context.Context,
	deps registry.Dependencies,
	rawConfig config.Component,
	logger golog.Logger,
) (movementsensor.MovementSensor, error)

NewAdxl345 is a constructor to create a new object representing an ADXL345 accelerometer.

Types

type AttrConfig

type AttrConfig struct {
	BoardName              string `json:"board"`
	I2cBus                 string `json:"i2c_bus"`
	UseAlternateI2CAddress bool   `json:"use_alternate_i2c_address"`
}

AttrConfig is a description of how to find an ADXL345 accelerometer on the robot.

func (*AttrConfig) Validate

func (cfg *AttrConfig) Validate(path string) ([]string, error)

Validate ensures all parts of the config are valid, and then returns the list of things we depend on.

Jump to

Keyboard shortcuts

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