mpu6050

package
v0.41.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2024 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

Package mpu6050 implements the movementsensor interface for an MPU-6050 6-axis accelerometer. A datasheet for this chip is at https://components101.com/sites/default/files/component_datasheet/MPU6050-DataSheet.pdf and a description of the I2C registers is at https://download.datasheets.com/pdfs/2015/3/19/8/3/59/59/invse_/manual/5rm-mpu-6000a-00v4.2.pdf

We support reading the accelerometer, gyroscope, and thermometer data off of the chip. We do not yet support using the digital interrupt pin to notify on events (freefall, collision, etc.), nor do we yet support using the secondary I2C connection to add an external clock or magnetometer.

The chip has two possible I2C addresses, which can be selected by wiring the AD0 pin to either hot or ground:

  • if AD0 is wired to ground, it uses the default I2C address of 0x68
  • if AD0 is wired to hot, it uses the alternate I2C address of 0x69

If you use the alternate address, your config file for this component must set its "use_alternate_i2c_address" boolean to true.

Package mpu6050 is only implemented for Linux systems.

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_alt_i2c_address,omitempty"`
}

Config is used to configure the attributes of the chip.

func (*Config) Validate added in v0.2.36

func (conf *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.

Jump to

Keyboard shortcuts

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