adxl345

package
v0.30.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2024 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Overview

Package adxl345 implements the MovementSensor interface for the ADXL345 accelerometer.

Package adxl345 is Linux-only.

Package adxl345 is for an ADXL345 accelerometer. This file is for the interrupt-based functionality on the chip.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config added in v0.2.36

type Config struct {
	I2cBus                 string          `json:"i2c_bus"`
	UseAlternateI2CAddress bool            `json:"use_alternate_i2c_address,omitempty"`
	BoardName              string          `json:"board,omitempty"`
	SingleTap              *TapConfig      `json:"tap,omitempty"`
	FreeFall               *FreeFallConfig `json:"free_fall,omitempty"`
}

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

func (*Config) Validate added in v0.2.36

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

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

type FreeFallConfig added in v0.2.36

type FreeFallConfig struct {
	AccelerometerPin int     `json:"accelerometer_pin"`
	InterruptPin     string  `json:"interrupt_pin"`
	Threshold        float32 `json:"threshold,omitempty"`
	Time             float32 `json:"time_ms,omitempty"`
}

FreeFallConfig is a description of the configs for free fall registers.

type InterruptID added in v0.2.26

type InterruptID = uint8

InterruptID is a type of interrupts available on ADXL345.

type TapConfig added in v0.2.36

type TapConfig struct {
	AccelerometerPin int     `json:"accelerometer_pin"`
	InterruptPin     string  `json:"interrupt_pin"`
	ExcludeX         bool    `json:"exclude_x,omitempty"`
	ExcludeY         bool    `json:"exclude_y,omitempty"`
	ExcludeZ         bool    `json:"exclude_z,omitempty"`
	Threshold        float32 `json:"threshold,omitempty"`
	Dur              float32 `json:"dur_us,omitempty"`
}

TapConfig is a description of the configs for tap registers.

Jump to

Keyboard shortcuts

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