Autodrone
Multi-Domain Vehicle
mpu6000.c File Reference

This file contains all the functions to initalize and read data from the MPU-6000. More...

#include "board.h"

Functions

bool mpu6000Init (void)
 MPU-6000 initialization sequence. More...
 
void readMPU6000 (void)
 Reads MPU-6000 raw data and packs accel, gyro, temp data into variables. More...
 
void computeMPU6000RTData (void)
 Computes IMU runtime data to find gyro bias. More...
 
void computeMPU6000TCBias (void)
 Calculates the IMU temperature bias. More...
 

Variables

float accelOneG = 9.8065
 
uint8_t rawData [16]
 
int32_t accelSum500Hz [3] = { 0, 0, 0 }
 
int32_t accelSummedSamples500Hz [3]
 
float accelTCBias [3] = { 0.0f, 0.0f, 0.0f }
 
int16andUint8_t rawAccel [3]
 
float nonRotatedAccelData [3]
 
float gyroRTBias [3]
 
int32_t gyroSum500Hz [3] = { 0, 0, 0 }
 
int32_t gyroSummedSamples500Hz [3]
 
float gyroTCBias [3]
 
int16andUint8_t rawGyro [3]
 
float nonRotatedGyroData [3]
 
uint8_t accelCalibrating = false
 
uint8_t mpu6000Calibrating = false
 
float mpu6000Temperature
 
int16andUint8_t rawMPU6000Temperature
 
uint8_t whoami [3]
 
bool mpu6000Initialized = false
 

Detailed Description

This file contains all the functions to initalize and read data from the MPU-6000.

Author
Jeremy Wolfe
Date
06 MAR 2022

Function Documentation

◆ computeMPU6000RTData()

void computeMPU6000RTData ( void  )

Computes IMU runtime data to find gyro bias.

Returns
Void.

◆ computeMPU6000TCBias()

void computeMPU6000TCBias ( void  )

Calculates the IMU temperature bias.

Returns
Void.

◆ mpu6000Init()

bool mpu6000Init ( void  )

MPU-6000 initialization sequence.

Returns
bool True if initialization was successful. False if unsuccessful.

◆ readMPU6000()

void readMPU6000 ( void  )

Reads MPU-6000 raw data and packs accel, gyro, temp data into variables.

Returns
Void.

Variable Documentation

◆ accelCalibrating

uint8_t accelCalibrating = false

◆ accelOneG

float accelOneG = 9.8065

◆ accelSum500Hz

int32_t accelSum500Hz[3] = { 0, 0, 0 }

◆ accelSummedSamples500Hz

int32_t accelSummedSamples500Hz[3]

◆ accelTCBias

float accelTCBias[3] = { 0.0f, 0.0f, 0.0f }

◆ gyroRTBias

float gyroRTBias[3]

◆ gyroSum500Hz

int32_t gyroSum500Hz[3] = { 0, 0, 0 }

◆ gyroSummedSamples500Hz

int32_t gyroSummedSamples500Hz[3]

◆ gyroTCBias

float gyroTCBias[3]

◆ mpu6000Calibrating

uint8_t mpu6000Calibrating = false

◆ mpu6000Initialized

bool mpu6000Initialized = false

◆ mpu6000Temperature

float mpu6000Temperature

◆ nonRotatedAccelData

float nonRotatedAccelData[3]

◆ nonRotatedGyroData

float nonRotatedGyroData[3]

◆ rawAccel

int16andUint8_t rawAccel[3]

◆ rawData

uint8_t rawData[16]

◆ rawGyro

int16andUint8_t rawGyro[3]

◆ rawMPU6000Temperature

int16andUint8_t rawMPU6000Temperature

◆ whoami

uint8_t whoami[3]