Ke Ao Teensy Flight Software
The software on the Teensy in the Ke Ao cubesat.
Loading...
Searching...
No Matches
Artemis::Devices::IMU Class Reference

The satellite's Inertial Measurement Unit (IMU). More...

#include <artemis_devices.h>

Classes

struct  imubeacon
 The IMU beacon structure. More...
 

Public Member Functions

int32_t setup (void)
 Sets up I2C connection to IMU.
 
int32_t read (uint32_t uptime)
 Reads IMU and generates a packet on both RFM23 and Astrodev queues.
 

Public Attributes

Adafruit_LSM6DSOX * imu = new Adafruit_LSM6DSOX()
 

Detailed Description

The satellite's Inertial Measurement Unit (IMU).

An instance of the Adafruit LSM6DSOX Inertial Measurement Unit (IMU) object.

Member Function Documentation

◆ read()

int32_t Artemis::Devices::IMU::read ( uint32_t  uptime)

Reads IMU and generates a packet on both RFM23 and Astrodev queues.

Parameters
uptimeThe time, in milliseconds, that the Teensy has been powered on.
Returns
int32_t Always returns 0.

The IMU is only polled if it has been set up.

A packet and IMU beacon are created. The beacon is given an identification value.

The accelerometer and gyroscope are polled for their most recent measurements. These measurements are then saved in the IMU beacon.

The packet's header information is filled out, identifying the originator node, destination node, and packet type. The beacon is then copied into the payload of the packet. The packet is then copied into the RFM23 and Astrodev queues for transmission.

◆ setup()

int32_t Artemis::Devices::IMU::setup ( void  )

Sets up I2C connection to IMU.

Returns
int32_t Returns 0 if sucessful, -1 if failed.

The I2C connection is initiated.

If it fails, the function returns with an error value.

The range of the accelerometer is set. Possible options are:

  • LSM6DS_ACCEL_RANGE_2_G: +/- 2G
  • LSM6DS_ACCEL_RANGE_4_G: +/- 4G
  • LSM6DS_ACCEL_RANGE_8_G: +/- 8G
  • LSM6DS_ACCEL_RANGE_16_G: +/- 16G

The range of the gyroscope is set. Possible options are:

  • LSM6DS_GYRO_RANGE_125_DPS: +/- 125 dps
  • LSM6DS_GYRO_RANGE_250_DPS: +/- 250 dps
  • LSM6DS_GYRO_RANGE_500_DPS: +/- 500 dps
  • LSM6DS_GYRO_RANGE_1000_DPS: +/- 1000 dps
  • LSM6DS_GYRO_RANGE_2000_DPS: +/- 2000 dps

The data rates of the accelerometer and gyroscope are set. Possible options are:

  • LSM6DS_RATE_SHUTDOWN: Power down
  • LSM6DS_RATE_12_5_HZ: 12.5 Hz
  • LSM6DS_RATE_26_HZ: 26 Hz
  • LSM6DS_RATE_52_HZ: 52 Hz
  • LSM6DS_RATE_104_HZ: 104 Hz
  • LSM6DS_RATE_208_HZ: 208 Hz
  • LSM6DS_RATE_416_HZ: 416 Hz
  • LSM6DS_RATE_833_HZ: 833 Hz
  • LSM6DS_RATE_1_66K_HZ: 1.66 kHz
  • LSM6DS_RATE_3_33K_HZ: 3.33 kHz
  • LSM6DS_RATE_6_66K_HZ: 6.66 kHz

The documentation for this class was generated from the following files: