sensors

package
v0.0.0-...-b4d0ca1 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: BSD-3-Clause Imports: 7 Imported by: 2

Documentation

Overview

Package sensors provides a stratux interface to sensors used for AHRS calculations.

Package sensors provides a stratux interface to sensors used for AHRS calculations.

Package sensors provides a stratux interface to sensors used for AHRS calculations.

Package sensors provides a stratux interface to sensors used for AHRS calculations.

Package sensors provides a stratux interface to sensors used for AHRS calculations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BMP280

type BMP280 struct {
	// contains filtered or unexported fields
}

BMP280 represents a BMP280 sensor and implements the PressureSensor interface.

func NewBMP280

func NewBMP280(i2cbus *embd.I2CBus, freq time.Duration) (*BMP280, error)

NewBMP280 looks for a BMP280 connected on the I2C bus having one of the valid addresses and begins reading it.

func (*BMP280) Close

func (bmp *BMP280) Close()

Close stops the measurements of the BMP280

func (*BMP280) Pressure

func (bmp *BMP280) Pressure() (float64, error)

Pressure returns the current pressure in mbar measured by the BMP280

func (*BMP280) Temperature

func (bmp *BMP280) Temperature() (float64, error)

Temperature returns the current temperature in degrees C measured by the BMP280

type BMP388

type BMP388 struct {
	// contains filtered or unexported fields
}

func NewBMP388

func NewBMP388(i2cbus *embd.I2CBus) (*BMP388, error)

func (*BMP388) Close

func (bmp *BMP388) Close()

func (*BMP388) Pressure

func (bmp *BMP388) Pressure() (float64, error)

func (*BMP388) Temperature

func (bmp *BMP388) Temperature() (float64, error)

Temperature returns the current temperature in degrees C measured by the BMP280

type ICM20948

type ICM20948 struct {
	// contains filtered or unexported fields
}

ICM20948 represents an InvenSense ICM-20948 attached to the I2C bus and satisfies the IMUReader interface.

func NewICM20948

func NewICM20948(i2cbus *embd.I2CBus) (*ICM20948, error)

NewICM20948 returns an instance of the ICM-20948 IMUReader, connected to an ICM-20948 attached on the I2C bus with either valid address.

func (*ICM20948) Close

func (m *ICM20948) Close()

Close stops reading the MPU.

func (*ICM20948) Read

func (m *ICM20948) Read() (T int64, G1, G2, G3, A1, A2, A3, M1, M2, M3 float64, GAError, MAGError error)

Read returns the average (since last reading) time, Gyro X-Y-Z, Accel X-Y-Z, Mag X-Y-Z, error reading Gyro/Accel, and error reading Mag.

func (*ICM20948) ReadOne

func (m *ICM20948) ReadOne() (T int64, G1, G2, G3, A1, A2, A3, M1, M2, M3 float64, GAError, MAGError error)

ReadOne returns the most recent time, Gyro X-Y-Z, Accel X-Y-Z, Mag X-Y-Z, error reading Gyro/Accel, and error reading Mag.

type IMUReader

type IMUReader interface {
	// Read returns the average (since last reading) time, Gyro X-Y-Z, Accel X-Y-Z, Mag X-Y-Z,
	// error reading Gyro/Accel, and error reading Mag.
	Read() (T int64, G1, G2, G3, A1, A2, A3, M1, M2, M3 float64, GAError, MagError error)
	// ReadOne returns the most recent time, Gyro X-Y-Z, Accel X-Y-Z, Mag X-Y-Z,
	// error reading Gyro/Accel, and error reading Mag.
	ReadOne() (T int64, G1, G2, G3, A1, A2, A3, M1, M2, M3 float64, GAError, MagError error)
	// Close stops reading the MPU.
	Close()
}

IMUReader provides an interface to various Inertial Measurement Unit sensors, such as the InvenSense MPU9150 or MPU9250. It is a light abstraction on top of the current github.com/westphae/goflying MPU9250 driver so that it can accommodate other types of drivers.

type MPU9250

type MPU9250 struct {
	// contains filtered or unexported fields
}

MPU9250 represents an InvenSense MPU9250 attached to the I2C bus and satisfies the IMUReader interface.

func NewMPU9250

func NewMPU9250(i2cbus *embd.I2CBus) (*MPU9250, error)

NewMPU9250 returns an instance of the MPU9250 IMUReader, connected to an MPU9250 attached on the I2C bus with either valid address.

func (*MPU9250) Close

func (m *MPU9250) Close()

Close stops reading the MPU.

func (*MPU9250) Read

func (m *MPU9250) Read() (T int64, G1, G2, G3, A1, A2, A3, M1, M2, M3 float64, GAError, MAGError error)

Read returns the average (since last reading) time, Gyro X-Y-Z, Accel X-Y-Z, Mag X-Y-Z, error reading Gyro/Accel, and error reading Mag.

func (*MPU9250) ReadOne

func (m *MPU9250) ReadOne() (T int64, G1, G2, G3, A1, A2, A3, M1, M2, M3 float64, GAError, MAGError error)

ReadOne returns the most recent time, Gyro X-Y-Z, Accel X-Y-Z, Mag X-Y-Z, error reading Gyro/Accel, and error reading Mag.

type PressureReader

type PressureReader interface {
	Temperature() (temp float64, tempError error) // Temperature returns the temperature in degrees C.
	Pressure() (press float64, pressError error)  // Pressure returns the atmospheric pressure in mBar.
	Close()                                       // Close stops reading from the sensor.
}

PressureReader provides an interface to a sensor reading pressure and maybe temperature or humidity, like the BMP180 or BMP280.

Directories

Path Synopsis
Package bmp388 provides a driver for Bosch's BMP388 digital temperature & pressure sensor.
Package bmp388 provides a driver for Bosch's BMP388 digital temperature & pressure sensor.

Jump to

Keyboard shortcuts

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