Quaternion Does Not Name A Type

Greetings all,
I am relatively new to coding and I am trying to make a flight computer and keep running into this problem. I am unsure what to do. Please help, thanks!

Arduino: 1.8.13 (Windows Store 1.8.42.0) (Windows 10), Board: “Arduino Nano, ATmega328P (Old Bootloader)”

FlightComputer_Datalogging:1532:1: error: ‘Quaternion’ does not name a type; did you mean ‘union’?

Quaternion q; // [w, x, y, z] quaternion container

^~~~~~~~~~

union

FlightComputer_Datalogging:1533:1: error: ‘VectorInt16’ does not name a type; did you mean ‘directoryEntry’?

VectorInt16 aa; // [x, y, z] accel sensor measurements

^~~~~~~~~~~

directoryEntry

FlightComputer_Datalogging:1534:1: error: ‘VectorInt16’ does not name a type; did you mean ‘directoryEntry’?

VectorInt16 aaReal; // [x, y, z] gravity-free accel sensor measurements

^~~~~~~~~~~

directoryEntry

FlightComputer_Datalogging:1535:1: error: ‘VectorInt16’ does not name a type; did you mean ‘directoryEntry’?

VectorInt16 aaWorld; // [x, y, z] world-frame accel sensor measurements

^~~~~~~~~~~

directoryEntry

FlightComputer_Datalogging:1536:1: error: ‘VectorFloat’ does not name a type

VectorFloat gravity; // [x, y, z] gravity vector

^~~~~~~~~~~

FlightComputer_Datalogging:1542:1: error: ‘SFE_BMP180’ does not name a type; did you mean ‘SFE_BMP180_h’?

SFE_BMP180 BMP;

^~~~~~~~~~

SFE_BMP180_h

FlightComputer_Datalogging:1543:1: error: ‘MPU6050’ does not name a type

MPU6050 mpu;

^~~~~~~

C:\Users\blade\Downloads\FlightComputer_Datalogging\FlightComputer_Datalogging.ino: In function ‘void setup()’:

FlightComputer_Datalogging:1578:6: error: ‘BMP’ was not declared in this scope

if(BMP.begin()){

  ^~~

FlightComputer_Datalogging:1588:3: error: ‘mpu’ was not declared in this scope

mpu.initialize(); //start MPU

^~~

C:\Users\blade\Downloads\FlightComputer_Datalogging\FlightComputer_Datalogging.ino: In function ‘void loop()’:

FlightComputer_Datalogging:1655:14: error: ‘BMP’ was not declared in this scope

 status = BMP.startTemperature();

          ^~~

FlightComputer_Datalogging:1681:21: error: ‘mpu’ was not declared in this scope

     fifoCount = mpu.getFIFOCount();

                 ^~~

FlightComputer_Datalogging:1685:20: error: ‘mpu’ was not declared in this scope

 mpuIntStatus = mpu.getIntStatus();

                ^~~

In file included from c:\program files\windowsapps\arduinollc.arduinoide_1.8.42.0_x86__mdqgnx93n4wtt\hardware\tools\avr\avr\include\avr\io.h:99:0,

             from c:\program files\windowsapps\arduinollc.arduinoide_1.8.42.0_x86__mdqgnx93n4wtt\hardware\tools\avr\avr\include\avr\pgmspace.h:90,

             from C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\cores\arduino/Arduino.h:28,

             from C:\Users\blade\OneDrive\Documents\Arduino\libraries\I2Cdev/I2Cdev.h:85,

             from C:\Users\blade\Downloads\FlightComputer_Datalogging\FlightComputer_Datalogging.ino:1:

FlightComputer_Datalogging:1687:28: error: ‘MPU6050_INTERRUPT_FIFO_OFLOW_BIT’ was not declared in this scope

 if((mpuIntStatus & _BV(MPU6050_INTERRUPT_FIFO_OFLOW_BIT)) || fifoCount >=1024){

                        ^

FlightComputer_Datalogging:1692:32: error: ‘MPU6050_INTERRUPT_DMP_INT_BIT’ was not declared in this scope

 else if(mpuIntStatus & _BV(MPU6050_INTERRUPT_DMP_INT_BIT)){

                            ^

FlightComputer_Datalogging:1697:29: error: ‘q’ was not declared in this scope

   mpu.dmpGetQuaternion(&q, fifoBuffer);

                         ^

FlightComputer_Datalogging:1698:24: error: ‘aa’ was not declared in this scope

   mpu.dmpGetAccel(&aa, fifoBuffer);

                    ^~

C:\Users\blade\Downloads\FlightComputer_Datalogging\FlightComputer_Datalogging.ino:1698:24: note: suggested alternative: ‘a’

   mpu.dmpGetAccel(&aa, fifoBuffer);

                    ^~

                    a

FlightComputer_Datalogging:1699:26: error: ‘gravity’ was not declared in this scope

   mpu.dmpGetGravity(&gravity, &q);

                      ^~~~~~~

FlightComputer_Datalogging:1700:30: error: ‘aaReal’ was not declared in this scope

   mpu.dmpGetLinearAccel(&aaReal, &aa, &gravity);

                          ^~~~~~

FlightComputer_Datalogging:1752:2: error: expected primary-expression before ‘/’ token

*/

^

FlightComputer_Datalogging:1763:1: error: expected primary-expression before ‘class’

class SFE_BMP180

^~~~~

FlightComputer_Datalogging:1858:2: error: expected primary-expression before ‘/’ token

*/

^

FlightComputer_Datalogging:1967:23: error: qualified-id in declaration before ‘(’ token

int8_t I2Cdev::readBit(uint8_t devAddr, uint8_t regAddr, uint8_t bitNum, uint8_t *data, uint16_t timeout) {

                   ^

FlightComputer_Datalogging:1982:24: error: qualified-id in declaration before ‘(’ token

int8_t I2Cdev::readBitW(uint8_t devAddr, uint8_t regAddr, uint8_t bitNum, uint16_t *data, uint16_t timeout) {

                    ^

FlightComputer_Datalogging:1998:24: error: qualified-id in declaration before ‘(’ token

int8_t I2Cdev::readBits(uint8_t devAddr, uint8_t regAddr, uint8_t bitStart, uint8_t length, uint8_t *data, uint16_t timeout) {

                    ^

FlightComputer_Datalogging:2023:25: error: qualified-id in declaration before ‘(’ token

int8_t I2Cdev::readBitsW(uint8_t devAddr, uint8_t regAddr, uint8_t bitStart, uint8_t length, uint16_t *data, uint16_t timeout) {

                     ^

FlightComputer_Datalogging:2047:24: error: qualified-id in declaration before ‘(’ token

int8_t I2Cdev::readByte(uint8_t devAddr, uint8_t regAddr, uint8_t *data, uint16_t timeout) {

                    ^

FlightComputer_Datalogging:2058:24: error: qualified-id in declaration before ‘(’ token

int8_t I2Cdev::readWord(uint8_t devAddr, uint8_t regAddr, uint16_t *data, uint16_t timeout) {

                    ^

FlightComputer_Datalogging:2070:25: error: qualified-id in declaration before ‘(’ token

int8_t I2Cdev::readBytes(uint8_t devAddr, uint8_t regAddr, uint8_t length, uint8_t *data, uint16_t timeout) {

                     ^

FlightComputer_Datalogging:2190:25: error: qualified-id in declaration before ‘(’ token

int8_t I2Cdev::readWords(uint8_t devAddr, uint8_t regAddr, uint8_t length, uint16_t *data, uint16_t timeout) {

                     ^

FlightComputer_Datalogging:2341:22: error: qualified-id in declaration before ‘(’ token

bool I2Cdev::writeBit(uint8_t devAddr, uint8_t regAddr, uint8_t bitNum, uint8_t data) {

                  ^

FlightComputer_Datalogging:2355:23: error: qualified-id in declaration before ‘(’ token

bool I2Cdev::writeBitW(uint8_t devAddr, uint8_t regAddr, uint8_t bitNum, uint16_t data) {

                   ^

FlightComputer_Datalogging:2370:23: error: qualified-id in declaration before ‘(’ token

bool I2Cdev::writeBits(uint8_t devAddr, uint8_t regAddr, uint8_t bitStart, uint8_t length, uint8_t data) {

                   ^

FlightComputer_Datalogging:2399:24: error: qualified-id in declaration before ‘(’ token

bool I2Cdev::writeBitsW(uint8_t devAddr, uint8_t regAddr, uint8_t bitStart, uint8_t length, uint16_t data) {

                    ^

FlightComputer_Datalogging:2426:23: error: qualified-id in declaration before ‘(’ token

bool I2Cdev::writeByte(uint8_t devAddr, uint8_t regAddr, uint8_t data) {

                   ^

FlightComputer_Datalogging:2436:23: error: qualified-id in declaration before ‘(’ token

bool I2Cdev::writeWord(uint8_t devAddr, uint8_t regAddr, uint16_t data) {

                   ^

FlightComputer_Datalogging:2447:24: error: qualified-id in declaration before ‘(’ token

bool I2Cdev::writeBytes(uint8_t devAddr, uint8_t regAddr, uint8_t length, uint8_t* data) {

                    ^

FlightComputer_Datalogging:2508:24: error: qualified-id in declaration before ‘(’ token

bool I2Cdev::writeWords(uint8_t devAddr, uint8_t regAddr, uint8_t length, uint16_t* data) {

                    ^

FlightComputer_Datalogging:2569:30: error: qualified-id in declaration before ‘=’ token

uint16_t I2Cdev::readTimeout = I2CDEV_DEFAULT_READ_TIMEOUT;

                          ^

FlightComputer_Datalogging:3554:31: error: qualified-id in declaration before ‘(’ token

uint8_t MPU6050::dmpInitialize() {

                           ^

FlightComputer_Datalogging:3663:33: error: qualified-id in declaration before ‘(’ token

bool MPU6050::dmpPacketAvailable() {

                             ^

FlightComputer_Datalogging:3690:29: error: qualified-id in declaration before ‘(’ token

uint8_t MPU6050::dmpGetAccel(int32_t data, const uint8_t packet) {

                         ^

FlightComputer_Datalogging:3698:29: error: qualified-id in declaration before ‘(’ token

uint8_t MPU6050::dmpGetAccel(int16_t data, const uint8_t packet) {

                         ^

FlightComputer_Datalogging:3706:29: error: qualified-id in declaration before ‘(’ token

uint8_t MPU6050::dmpGetAccel(VectorInt16 v, const uint8_t packet) {

                         ^

FlightComputer_Datalogging:3714:34: error: qualified-id in declaration before ‘(’ token

uint8_t MPU6050::dmpGetQuaternion(int32_t data, const uint8_t packet) {

                              ^

FlightComputer_Datalogging:3723:34: error: qualified-id in declaration before ‘(’ token

uint8_t MPU6050::dmpGetQuaternion(int16_t data, const uint8_t packet) {

                              ^

FlightComputer_Datalogging:3732:34: error: qualified-id in declaration before ‘(’ token

uint8_t MPU6050::dmpGetQuaternion(Quaternion q, const uint8_t packet) {

                              ^

FlightComputer_Datalogging:3747:28: error: qualified-id in declaration before ‘(’ token

uint8_t MPU6050::dmpGetGyro(int32_t data, const uint8_t packet) {

                        ^

FlightComputer_Datalogging:3755:28: error: qualified-id in declaration before ‘(’ token

uint8_t MPU6050::dmpGetGyro(int16_t data, const uint8_t packet) {

                        ^

FlightComputer_Datalogging:3763:28: error: qualified-id in declaration before ‘(’ token

uint8_t MPU6050::dmpGetGyro(VectorInt16 v, const uint8_t packet) {

                        ^

FlightComputer_Datalogging:3773:35: error: qualified-id in declaration before ‘(’ token

uint8_t MPU6050::dmpGetLinearAccel(VectorInt16 *v, VectorInt16 *vRaw, VectorFloat *gravity) {

                               ^

FlightComputer_Datalogging:3781:42: error: qualified-id in declaration before ‘(’ token

uint8_t MPU6050::dmpGetLinearAccelInWorld(VectorInt16 *v, VectorInt16 *vReal, Quaternion *q) {

                                      ^

FlightComputer_Datalogging:3793:31: error: qualified-id in declaration before ‘(’ token

uint8_t MPU6050::dmpGetGravity(int16_t data, const uint8_t packet) {

                           ^

FlightComputer_Datalogging:3804:31: error: qualified-id in declaration before ‘(’ token

uint8_t MPU6050::dmpGetGravity(VectorFloat *v, Quaternion *q) {

                           ^

FlightComputer_Datalogging:3815:29: error: qualified-id in declaration before ‘(’ token

uint8_t MPU6050::dmpGetEuler(float *data, Quaternion *q) {

                         ^

FlightComputer_Datalogging:3833:36: error: qualified-id in declaration before ‘(’ token

uint8_t MPU6050::dmpGetYawPitchRoll(float *data, Quaternion *q, VectorFloat *gravity) {

                                ^

FlightComputer_Datalogging:3854:38: error: qualified-id in declaration before ‘(’ token

uint8_t MPU6050::dmpProcessFIFOPacket(const unsigned char *dmpData) {

                                  ^

FlightComputer_Datalogging:3864:45: error: qualified-id in declaration before ‘(’ token

uint8_t MPU6050::dmpReadAndProcessFIFOPacket(uint8_t numPackets, uint8_t *processed) {

                                         ^

FlightComputer_Datalogging:3889:39: error: qualified-id in declaration before ‘(’ token

uint16_t MPU6050::dmpGetFIFOPacketSize() {

                                   ^

FlightComputer_Datalogging:3895:41: error: qualified-id in declaration before ‘(’ token

uint8_t MPU6050::dmpGetCurrentFIFOPacket(uint8_t *data) { // overflow proof

                                     ^

exit status 1

‘Quaternion’ does not name a type; did you mean ‘union’?

This report would have more information with
“Show verbose output during compilation”
option enabled in File → Preferences.

You are missing some libraries and have errors in the code.

Post the code, using code tags.

Thank you so incredibly much! When I say I am new…I am new new lol, therefore, I honestly am not sure how to upload it with tags. I added the link to where I found the zip file, but even when I import it as a zip file it still gives me a missing library error.

Sounds like you have taken on an extremely ambitious project for a beginner! i2cdevlib is a library that facilitates communication with generic i2c devices, so you will be needing other libraries.

Why not take a moment to describe the actual project?

For posting instructions, check out the links a the top of every forum category.

lol I figured as much when I quickly found myself need as much help as possible. It is a rocket flight computer that essentially measures altitude through the bmp and writes it to a microSD for mining. I will be using to achieve my level 2 certification through the NAR.
I will hunt the links down and post as soon as possible. Again, thank you infinitely.

You don’t need i2cdevlib to read the BMP pressure sensor. Wire will work, and there are lots of code examples available.

1 Like

I have been trying to figure out how to post this code for days, but cannot seem to do it. My apologies as I will probably just scrap the project because I do not know what to do. Thank you

how to post this code

Select and copy the code into the clipboard, click on “</>” in the post editor, and paste where it says to paste.

Arduino: 1.8.13 (Windows Store 1.8.42.0) (Windows 10), Board: "Arduino Nano, ATmega328P (Old Bootloader)"





















libraries\Arduino-I2C-master\main.cpp.o (symbol from plugin): In function `setup':

(.text+0x0): multiple definition of `setup'

sketch\FlightComputer_Datalogging.ino.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\Arduino-I2C-master\main.cpp.o (symbol from plugin): In function `setup':

(.text+0x0): multiple definition of `loop'

sketch\FlightComputer_Datalogging.ino.cpp.o (symbol from plugin):(.text+0x0): first defined here

collect2.exe: error: ld returned 1 exit status

Multiple libraries were found for "I2C_16Bit.h"

 Used: C:\Users\blade\OneDrive\Documents\Arduino\libraries\Arduino-I2C-master

 Not used: C:\Users\blade\OneDrive\Documents\Arduino\libraries\I2C

exit status 1

Error compiling for board Arduino Nano.

Invalid library found in C:\Users\blade\OneDrive\Documents\Arduino\libraries\Arduino: no headers files (.h) found in C:\Users\blade\OneDrive\Documents\Arduino\libraries\Arduino

Invalid library found in C:\Users\blade\OneDrive\Documents\Arduino\libraries\Flights: no headers files (.h) found in C:\Users\blade\OneDrive\Documents\Arduino\libraries\Flights

Invalid library found in C:\Users\blade\OneDrive\Documents\Arduino\libraries\libraries: no headers files (.h) found in C:\Users\blade\OneDrive\Documents\Arduino\libraries\libraries

Invalid library found in C:\Users\blade\OneDrive\Documents\Arduino\libraries\Arduino: no headers files (.h) found in C:\Users\blade\OneDrive\Documents\Arduino\libraries\Arduino

Invalid library found in C:\Users\blade\OneDrive\Documents\Arduino\libraries\Flights: no headers files (.h) found in C:\Users\blade\OneDrive\Documents\Arduino\libraries\Flights

Invalid library found in C:\Users\blade\OneDrive\Documents\Arduino\libraries\libraries: no headers files (.h) found in C:\Users\blade\OneDrive\Documents\Arduino\libraries\libraries



This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

There appear to be major problems with your Arduino installation. If this is your first time using Arduino, delete the entire Arduino package, and reinstall it. Test it by compiling, loading and running the Blink example, after selecting your board and programmer.

At some point you should post the CODE you are trying to compile. It looks like there are two copies of that, or two independent programs, as well. You can have only one Arduino program, with one setup() and one loop() function at a time.

[code]
/*MODEL ROCKET FLIGHT COMPUTER
 * Datalogging program
 * Written by Matt Minogue, also known as @LabRatMatt on YouTube and Instructables
 * Note that much of the IMU Code derives from Jeff Rowberg's MPU6050 Demo Code, the copyright statement and liscense are included
 * 
 */
 //Changelog
 //12-29-2019 Created Program to test buzzer on Pin 3, tested library inclusion
 //01-04-2020 Finished hardware, wrote datalogging capability for temp and pressure
 //01-05-2020 Created datalogging program that includes modes and IMU data
 //01-07-2020 Implemented linear acceleration datalogging, ran into FIFO overflow issues
 //01-09-2020 Implemented angular position datalogging, yet to resolve FIFO overflow issues
 //01-18-2020 Added dataRate variable to set ideal number of data points per second
 //02-08-2020 Modified code to make better use of preprocessor directives in place of variables, effect on memory is minimal
 //05-21-2020 Added additional comments and clarifications in preparation for publication on Instructables
/* ============================================
I2Cdev device library code is placed under the MIT license
Copyright (c) 2012 Jeff Rowberg

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
===============================================
*/

#include <SD.h>           //includes SD card library for datalogging
#include <Wire.h>         //includes Wire.h library for I2C interface
#include <SFE_BMP180.h>   //includes SparkFun's BMP 180 library

// For the IMU
// I2Cdev and MPU6050 must be installed as libraries, or else the .cpp/.h files
// for both classes must be in the include path of your project
#include "I2Cdev.h"
#include "MPU6050_6Axis_MotionApps20.h" //#include "MPU6050.h" not necessary if using MotionApps include file

// Arduino Wire library is required if I2Cdev I2CDEV_ARDUINO_WIRE implementation is used in I2Cdev.h
#if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE
    #include "Wire.h"
#endif

//define relevant pins
#define INTERRUPT_PIN 2  //I2C Interrupt Pin for MPU6050, use pin 2 on Arduino Uno & most boards
#define BUZZER_PIN 3     //set buzzer pin
#define BLUE_LED_PIN 8   //set blue LED pin
#define YELLOW_LED_PIN 9 //set yellow LED pin
#define RED_LED_PIN 10   //set red LED pin
#define BUTTON_PIN 7     //set button pin
#define chipSelect 4     //set chip select pin for MicroSD Card Adapter (CS pin)

//declare general use variables
int buttonState = 0;
int MODE = 0;       //initialize mode to zero
int t = 0;          //create timestamp value
int dataRate = 10;  //set specified sampling rate (data points per second) (somewhere between 10-200 is ideal)

//declare MPU control/status vars
bool blinkState = false;
bool dmpReady = false;  // set true if DMP init was successful
uint8_t mpuIntStatus;   // holds actual interrupt status byte from MPU
uint8_t devStatus;      // return status after each device operation (0 = success, !0 = error)
uint16_t packetSize;    // expected DMP packet size (default is 42 bytes)
uint16_t fifoCount;     // count of all bytes currently in FIFO
uint8_t fifoBuffer[64]; // FIFO storage buffer

//declare orientation/motion vars
Quaternion q;           // [w, x, y, z]         quaternion container
VectorInt16 aa;         // [x, y, z]            accel sensor measurements
VectorInt16 aaReal;     // [x, y, z]            gravity-free accel sensor measurements
VectorInt16 aaWorld;    // [x, y, z]            world-frame accel sensor measurements
VectorFloat gravity;    // [x, y, z]            gravity vector
float euler[3];         // [psi, theta, phi]    Euler angle container
float ypr[3];           // [yaw, pitch, roll]   yaw/pitch/roll container and gravity vector

//create objects
File file; 
SFE_BMP180 BMP;
MPU6050 mpu;

//Interrupt Detection Routine
volatile bool mpuInterrupt = false;     // indicates whether MPU interrupt pin has gone high
void dmpDataReady() {
    mpuInterrupt = true;
}

void setup() {
  //--- Serial Debugging --- 
  Serial.begin(9600); 
  //--- Establish Pin Modes and turn off all LEDs ---
  pinMode(BUZZER_PIN, OUTPUT);
  pinMode(BLUE_LED_PIN, OUTPUT);
  pinMode(YELLOW_LED_PIN, OUTPUT);
  pinMode(RED_LED_PIN, OUTPUT);
  pinMode(chipSelect, OUTPUT);
  pinMode(BUTTON_PIN, INPUT);
  pinMode(INTERRUPT_PIN, INPUT);
  digitalWrite(YELLOW_LED_PIN, LOW);
  digitalWrite(RED_LED_PIN, LOW);
  digitalWrite(BLUE_LED_PIN, LOW);
  tone(BUZZER_PIN, 500, 250);
  //initialize SD Card
  if(!SD.begin(chipSelect)){
    //Serial debugging
    Serial.println("Could not initialize SD card");
  }
  //clear SD data
  if(SD.exists("file.txt")){
    if(SD.remove("file.txt") == true){
      Serial.println("removed data");
    }
  }
  //initialize BMP sensor
  if(BMP.begin()){
    Serial.println("BMP init success");
  }
  //initialize IMU and I2C clock
  #if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE  // join I2C bus (I2Cdev library doesn't do this automatically)
      Wire.begin();
      Wire.setClock(400000); // 400kHz I2C clock. Comment this line if having compilation difficulties
  #elif I2CDEV_IMPLEMENTATION == I2CDEV_BUILTIN_FASTWIRE
      Fastwire::setup(400, true);
  #endif
  mpu.initialize(); //start MPU
  Serial.println(F("Testing device connections...")); //debugging serial statement
  Serial.println(mpu.testConnection() ? F("MPU6050 connection successful") : F("MPU6050 connection failed")); //debugging serial statement
  devStatus = mpu.dmpInitialize();
  // supply your own gyro offsets here, scaled for min sensitivity
  mpu.setXGyroOffset(0);
  mpu.setYGyroOffset(0);
  mpu.setZGyroOffset(0);
  mpu.setZAccelOffset(1688); // 1688 factory default for my test chip
  if (devStatus == 0) {
      // turn on the DMP, now that it's ready
      Serial.println(F("Enabling DMP..."));
      mpu.setDMPEnabled(true);
      // enable Arduino interrupt detection
      Serial.print(F("Enabling interrupt detection (Arduino external interrupt "));
      Serial.print(digitalPinToInterrupt(INTERRUPT_PIN));
      Serial.println(F(")..."));
      attachInterrupt(digitalPinToInterrupt(INTERRUPT_PIN), dmpDataReady, RISING);
      mpuIntStatus = mpu.getIntStatus();
      // set our DMP Ready flag so the main loop() function knows it's okay to use it
      Serial.println(F("DMP ready! Waiting for first interrupt..."));
      dmpReady = true;
      // get expected DMP packet size for later comparison
      packetSize = mpu.dmpGetFIFOPacketSize();
  } else {
      // ERROR!
      // 1 = initial memory load failed
      // 2 = DMP configuration updates failed
      // (if it's going to break, usually the code will be 1)
      Serial.print(F("DMP Initialization failed (code "));
      Serial.print(devStatus);
      Serial.println(F(")"));
  }
  //set mode
  MODE = 1; //set to PAD IDLE mode - initialize sensors and SD card
  //MODE = 2; //set to FLIGHT mode - log data
  //MODE = 3; //set to RECOVERY mode - close file
}

void loop() {
  // put your main code here, to run repeatedly:
  if(MODE == 1){  //PAD IDLE MODE
    digitalWrite(RED_LED_PIN, HIGH);
    file = SD.open("file.txt", FILE_WRITE); //Open SD card file
    if(file) {
      Serial.println("t,T,P,ax,ay,az,rx,ry,rz"); //print first line with data labels
      file.println("t,T,P,ax,ay,az,rx,ry,rz");
      MODE = 2;
    }
    else{
      Serial.println("Error opening file");
      delay(5000); //just chill for 5 seconds before trying again
    }
  }
  if(MODE == 2){ //ACTIVE FLIGHT mode
    digitalWrite(YELLOW_LED_PIN, HIGH);
    digitalWrite(RED_LED_PIN, LOW);
    digitalWrite(BLUE_LED_PIN, LOW);
    //print timestamp and comma to separate data
    Serial.print(t);
    Serial.print(",");
    file.print(t);
    file.print(",");
    //set up temperature and pressure sensor
    char status;
    double T,P,a;
    //get BMP status and read temperature
    status = BMP.startTemperature();
    if(status != 0){
      delay(status);
      status = BMP.getTemperature(T);
      if(status != 0){
        Serial.print(T); //print temperature values
        file.print(T);
      }
    }
    Serial.print(","); //print commas to separate values
    file.print(",");
    status = BMP.startPressure(3); //delay 3 ms to get temperature value
    if(status != 0){
      delay(status);
      status = BMP.getPressure(P,T);
      if(status != 0){
        Serial.print(P); //print pressure values
        file.print(P);
      }
    }
    Serial.print(",");
    file.print(",");
    //get IMU data
    if (!dmpReady) return;
    while (!mpuInterrupt && fifoCount < packetSize){
      if (mpuInterrupt && fifoCount < packetSize){
        fifoCount = mpu.getFIFOCount();
      }
    }
    mpuInterrupt = false;
    mpuIntStatus = mpu.getIntStatus();
    fifoCount = mpu.getFIFOCount();
    if((mpuIntStatus & _BV(MPU6050_INTERRUPT_FIFO_OFLOW_BIT)) || fifoCount >=1024){
      mpu.resetFIFO();
      fifoCount = mpu.getFIFOCount();
      Serial.println("FIFO Overflow!");
    }
    else if(mpuIntStatus & _BV(MPU6050_INTERRUPT_DMP_INT_BIT)){
      while(fifoCount < packetSize) fifoCount = mpu.getFIFOCount();
      mpu.getFIFOBytes(fifoBuffer, packetSize);
      fifoCount -= packetSize;
      //get real-world acceleration
      mpu.dmpGetQuaternion(&q, fifoBuffer);
      mpu.dmpGetAccel(&aa, fifoBuffer);
      mpu.dmpGetGravity(&gravity, &q);
      mpu.dmpGetLinearAccel(&aaReal, &aa, &gravity);
      //print real-world acceleration
      Serial.print(aaReal.x);
      file.print(aaReal.x);
      Serial.print(",");
      file.print(",");
      Serial.print(aaReal.y);
      file.print(aaReal.y);
      Serial.print(",");
      file.print(",");
      Serial.print(aaReal.z);
      file.print(aaReal.z);
      Serial.print(",");
      file.print(",");
      //get Euler angles
      mpu.dmpGetQuaternion(&q, fifoBuffer);
      mpu.dmpGetEuler(euler, &q);
      //print Euler angles
      Serial.print(euler[0]*180/M_PI);
      file.print(euler[0]*180/M_PI);
      Serial.print(",");
      file.print(",");
      Serial.print(euler[1]*180/M_PI);
      file.print(euler[1]*180/M_PI);
      Serial.print(",");
      file.print(",");
      Serial.print(euler[2]*180/M_PI);
      file.print(euler[2]*180/M_PI);
    }
    //end data entry line
    Serial.println(); //ends line
    file.println(); //ends line
    //check for mode switch
    buttonState = digitalRead(BUTTON_PIN);
    if(buttonState == LOW){
      MODE = 3;
      tone(BUZZER_PIN, 1000, 250);
      delay(100);
    }
  }
  if(MODE == 3){ //RECOVERY MODE
    file.close();
    digitalWrite(YELLOW_LED_PIN, LOW);
    digitalWrite(RED_LED_PIN, LOW);
    digitalWrite(BLUE_LED_PIN, HIGH);
    delay(1000);
  }
  t = t + 1;              //increment t value
  delay(1000/dataRate);   //pause so that data output corresponds to data rate
  if(t > 32765){          //prevents issues related to integers rolling over at 32767
    t = 1;
  }
}
[/code]

Thank you so much! I reinstalled and compiled the blink code, which compiled successfully

should I use the old bootloader option to remedy the compiling error?

Please post the error messages that result from compiling the code most recently posted.

The bootloader has nothing to do with compilation errors.

Arduino: 1.8.13 (Windows 10), Board: "Arduino Nano, ATmega328P (Old Bootloader)"





















In file included from C:\Users\blade\OneDrive\Desktop\FlightComputer_Datalogging\FlightComputer_Datalogging.ino:52:0:

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050_6Axis_MotionApps20.h: In member function 'uint8_t MPU6050::dmpGetGravity(int16_t*, const uint8_t*)':

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050_6Axis_MotionApps20.h:522:65: warning: integer overflow in expression [-Woverflow]

         - (int32_t)qI[2] * qI[2] + (int32_t)qI[3] * qI[3]) / (2 * 16384);

                                                               ~~^~~~~~~

C:\Users\blade\OneDrive\Documents\Arduino\libraries\Arduino-I2C-master\src\I2C_32Bit.cpp: In function 'uint32_t I2C_32Bit_readFromModule(uint8_t)':

C:\Users\blade\OneDrive\Documents\Arduino\libraries\Arduino-I2C-master\src\I2C_32Bit.cpp:17:24: warning: left shift count >= width of type [-Wshift-count-overflow]

   return (firstByte << 24) + (secondByte << 16) + (thirdByte << 8) + fourthByte;

                        ^~

C:\Users\blade\OneDrive\Documents\Arduino\libraries\Arduino-I2C-master\src\I2C_32Bit.cpp:17:45: warning: left shift count >= width of type [-Wshift-count-overflow]

   return (firstByte << 24) + (secondByte << 16) + (thirdByte << 8) + fourthByte;

                                             ^~

C:\Users\blade\OneDrive\Documents\Arduino\libraries\Arduino-I2C-master\src\I2C_32Bit.cpp: In function 'uint32_t I2C_32Bit_readFromModule(uint8_t, uint8_t)':

C:\Users\blade\OneDrive\Documents\Arduino\libraries\Arduino-I2C-master\src\I2C_32Bit.cpp:37:24: warning: left shift count >= width of type [-Wshift-count-overflow]

   return (firstByte << 24) + (secondByte << 16) + (thirdByte << 8) + fourthByte;

                        ^~

C:\Users\blade\OneDrive\Documents\Arduino\libraries\Arduino-I2C-master\src\I2C_32Bit.cpp:37:45: warning: left shift count >= width of type [-Wshift-count-overflow]

   return (firstByte << 24) + (secondByte << 16) + (thirdByte << 8) + fourthByte;

                                             ^~

libraries\Arduino-I2C-master\main.cpp.o (symbol from plugin): In function `setup':

(.text+0x0): multiple definition of `setup'

sketch\FlightComputer_Datalogging.ino.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\Arduino-I2C-master\main.cpp.o (symbol from plugin): In function `setup':

(.text+0x0): multiple definition of `loop'

sketch\FlightComputer_Datalogging.ino.cpp.o (symbol from plugin):(.text+0x0): first defined here

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:436:7: warning: type 'struct MPU6050' violates the C++ One Definition Rule [-Wodr]

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.h:436:7: note: a different type is defined in another translation unit

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:1036:18: note: the first difference of corresponding definitions is field 'dmpPacketBuffer'

         uint8_t *dmpPacketBuffer;

                  ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.h:436:7: note: a type with different number of fields is defined in another translation unit

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:440:14: warning: 'initialize' violates the C++ One Definition Rule  [-Wodr]

         void initialize();

              ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:56:6: note: implicit this pointer type mismatch

 void MPU6050::initialize() {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.h:436:7: note: type 'struct MPU6050' itself violates the C++ One Definition Rule

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:436:7: note: the incompatible type is defined here

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:56:6: note: 'initialize' was previously declared here

 void MPU6050::initialize() {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:56:6: note: code may be misoptimized unless -fno-strict-aliasing is used

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:441:14: warning: 'testConnection' violates the C++ One Definition Rule  [-Wodr]

         bool testConnection();

              ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:67:6: note: implicit this pointer type mismatch

 bool MPU6050::testConnection() {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.h:436:7: note: type 'struct MPU6050' itself violates the C++ One Definition Rule

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:436:7: note: the incompatible type is defined here

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:67:6: note: 'testConnection' was previously declared here

 bool MPU6050::testConnection() {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:67:6: note: code may be misoptimized unless -fno-strict-aliasing is used

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:767:14: warning: 'setXGyroOffset' violates the C++ One Definition Rule  [-Wodr]

         void setXGyroOffset(int16_t offset);

              ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:2929:6: note: implicit this pointer type mismatch

 void MPU6050::setXGyroOffset(int16_t offset) {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.h:436:7: note: type 'struct MPU6050' itself violates the C++ One Definition Rule

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:436:7: note: the incompatible type is defined here

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:2929:6: note: 'setXGyroOffset' was previously declared here

 void MPU6050::setXGyroOffset(int16_t offset) {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:2929:6: note: code may be misoptimized unless -fno-strict-aliasing is used

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:771:14: warning: 'setYGyroOffset' violates the C++ One Definition Rule  [-Wodr]

         void setYGyroOffset(int16_t offset);

              ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:2939:6: note: implicit this pointer type mismatch

 void MPU6050::setYGyroOffset(int16_t offset) {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.h:436:7: note: type 'struct MPU6050' itself violates the C++ One Definition Rule

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:436:7: note: the incompatible type is defined here

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:2939:6: note: 'setYGyroOffset' was previously declared here

 void MPU6050::setYGyroOffset(int16_t offset) {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:2939:6: note: code may be misoptimized unless -fno-strict-aliasing is used

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:775:14: warning: 'setZGyroOffset' violates the C++ One Definition Rule  [-Wodr]

         void setZGyroOffset(int16_t offset);

              ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:2949:6: note: implicit this pointer type mismatch

 void MPU6050::setZGyroOffset(int16_t offset) {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.h:436:7: note: type 'struct MPU6050' itself violates the C++ One Definition Rule

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:436:7: note: the incompatible type is defined here

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:2949:6: note: 'setZGyroOffset' was previously declared here

 void MPU6050::setZGyroOffset(int16_t offset) {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:2949:6: note: code may be misoptimized unless -fno-strict-aliasing is used

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:763:14: warning: 'setZAccelOffset' violates the C++ One Definition Rule  [-Wodr]

         void setZAccelOffset(int16_t offset);

              ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:2918:6: note: implicit this pointer type mismatch

 void MPU6050::setZAccelOffset(int16_t offset) {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.h:436:7: note: type 'struct MPU6050' itself violates the C++ One Definition Rule

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:436:7: note: the incompatible type is defined here

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:2918:6: note: 'setZAccelOffset' was previously declared here

 void MPU6050::setZAccelOffset(int16_t offset) {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:2918:6: note: code may be misoptimized unless -fno-strict-aliasing is used

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:717:10: warning: 'GetCurrentFIFOPacket' violates the C++ One Definition Rule  [-Wodr]

   int8_t GetCurrentFIFOPacket(uint8_t *data, uint8_t length);

          ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:2751:9: note: implicit this pointer type mismatch

  int8_t MPU6050::GetCurrentFIFOPacket(uint8_t *data, uint8_t length) { // overflow proof

         ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.h:436:7: note: type 'struct MPU6050' itself violates the C++ One Definition Rule

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:436:7: note: the incompatible type is defined here

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:2751:9: note: 'GetCurrentFIFOPacket' was previously declared here

  int8_t MPU6050::GetCurrentFIFOPacket(uint8_t *data, uint8_t length) { // overflow proof

         ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:2751:9: note: code may be misoptimized unless -fno-strict-aliasing is used

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:719:14: warning: 'getFIFOBytes' violates the C++ One Definition Rule  [-Wodr]

         void getFIFOBytes(uint8_t *data, uint8_t length);

              ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:2736:6: note: implicit this pointer type mismatch

 void MPU6050::getFIFOBytes(uint8_t *data, uint8_t length) {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.h:436:7: note: type 'struct MPU6050' itself violates the C++ One Definition Rule

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:436:7: note: the incompatible type is defined here

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:2736:6: note: 'getFIFOBytes' was previously declared here

 void MPU6050::getFIFOBytes(uint8_t *data, uint8_t length) {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:2736:6: note: code may be misoptimized unless -fno-strict-aliasing is used

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:713:18: warning: 'getFIFOCount' violates the C++ One Definition Rule  [-Wodr]

         uint16_t getFIFOCount();

                  ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:2700:10: note: implicit this pointer type mismatch

 uint16_t MPU6050::getFIFOCount() {

          ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.h:436:7: note: type 'struct MPU6050' itself violates the C++ One Definition Rule

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:436:7: note: the incompatible type is defined here

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:2700:10: note: 'getFIFOCount' was previously declared here

 uint16_t MPU6050::getFIFOCount() {

          ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:2700:10: note: code may be misoptimized unless -fno-strict-aliasing is used

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:686:14: warning: 'reset' violates the C++ One Definition Rule  [-Wodr]

         void reset();

              ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:2418:6: note: implicit this pointer type mismatch

 void MPU6050::reset() {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.h:436:7: note: type 'struct MPU6050' itself violates the C++ One Definition Rule

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:436:7: note: the incompatible type is defined here

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:2418:6: note: 'reset' was previously declared here

 void MPU6050::reset() {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:2418:6: note: code may be misoptimized unless -fno-strict-aliasing is used

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:688:14: warning: 'setSleepEnabled' violates the C++ One Definition Rule  [-Wodr]

         void setSleepEnabled(bool enabled);

              ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:2442:6: note: implicit this pointer type mismatch

 void MPU6050::setSleepEnabled(bool enabled) {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.h:436:7: note: type 'struct MPU6050' itself violates the C++ One Definition Rule

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:436:7: note: the incompatible type is defined here

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:2442:6: note: 'setSleepEnabled' was previously declared here

 void MPU6050::setSleepEnabled(bool enabled) {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:2442:6: note: code may be misoptimized unless -fno-strict-aliasing is used

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:804:14: warning: 'setMemoryStartAddress' violates the C++ One Definition Rule  [-Wodr]

         void setMemoryStartAddress(uint8_t address);

              ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:3032:6: note: implicit this pointer type mismatch

 void MPU6050::setMemoryStartAddress(uint8_t address) {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.h:436:7: note: type 'struct MPU6050' itself violates the C++ One Definition Rule

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:436:7: note: the incompatible type is defined here

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:3032:6: note: 'setMemoryStartAddress' was previously declared here

 void MPU6050::setMemoryStartAddress(uint8_t address) {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:3032:6: note: code may be misoptimized unless -fno-strict-aliasing is used

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:801:14: warning: 'setMemoryBank' violates the C++ One Definition Rule  [-Wodr]

         void setMemoryBank(uint8_t bank, bool prefetchEnabled=false, bool userBank=false);

              ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:3023:6: note: implicit this pointer type mismatch

 void MPU6050::setMemoryBank(uint8_t bank, bool prefetchEnabled, bool userBank) {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.h:436:7: note: type 'struct MPU6050' itself violates the C++ One Definition Rule

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:436:7: note: the incompatible type is defined here

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:3023:6: note: 'setMemoryBank' was previously declared here

 void MPU6050::setMemoryBank(uint8_t bank, bool prefetchEnabled, bool userBank) {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:3023:6: note: code may be misoptimized unless -fno-strict-aliasing is used

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:679:14: warning: 'setI2CMasterModeEnabled' violates the C++ One Definition Rule  [-Wodr]

         void setI2CMasterModeEnabled(bool enabled);

              ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:2367:6: note: implicit this pointer type mismatch

 void MPU6050::setI2CMasterModeEnabled(bool enabled) {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.h:436:7: note: type 'struct MPU6050' itself violates the C++ One Definition Rule

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:436:7: note: the incompatible type is defined here

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:2367:6: note: 'setI2CMasterModeEnabled' was previously declared here

 void MPU6050::setI2CMasterModeEnabled(bool enabled) {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:2367:6: note: code may be misoptimized unless -fno-strict-aliasing is used

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:538:14: warning: 'setSlaveAddress' violates the C++ One Definition Rule  [-Wodr]

         void setSlaveAddress(uint8_t num, uint8_t address);

              ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:963:6: note: implicit this pointer type mismatch

 void MPU6050::setSlaveAddress(uint8_t num, uint8_t address) {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.h:436:7: note: type 'struct MPU6050' itself violates the C++ One Definition Rule

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:436:7: note: the incompatible type is defined here

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:963:6: note: 'setSlaveAddress' was previously declared here

 void MPU6050::setSlaveAddress(uint8_t num, uint8_t address) {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:963:6: note: code may be misoptimized unless -fno-strict-aliasing is used

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:682:14: warning: 'resetI2CMaster' violates the C++ One Definition Rule  [-Wodr]

         void resetI2CMaster();

              ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:2392:6: note: implicit this pointer type mismatch

 void MPU6050::resetI2CMaster() {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.h:436:7: note: type 'struct MPU6050' itself violates the C++ One Definition Rule

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:436:7: note: the incompatible type is defined here

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:2392:6: note: 'resetI2CMaster' was previously declared here

 void MPU6050::resetI2CMaster() {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:2392:6: note: code may be misoptimized unless -fno-strict-aliasing is used

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:694:14: warning: 'setClockSource' violates the C++ One Definition Rule  [-Wodr]

         void setClockSource(uint8_t source);

              ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:2535:6: note: implicit this pointer type mismatch

 void MPU6050::setClockSource(uint8_t source) {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.h:436:7: note: type 'struct MPU6050' itself violates the C++ One Definition Rule

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:436:7: note: the incompatible type is defined here

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:2535:6: note: 'setClockSource' was previously declared here

 void MPU6050::setClockSource(uint8_t source) {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:2535:6: note: code may be misoptimized unless -fno-strict-aliasing is used

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:598:14: warning: 'setIntEnabled' violates the C++ One Definition Rule  [-Wodr]

         void setIntEnabled(uint8_t enabled);

              ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:1550:6: note: implicit this pointer type mismatch

 void MPU6050::setIntEnabled(uint8_t enabled) {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.h:436:7: note: type 'struct MPU6050' itself violates the C++ One Definition Rule

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:436:7: note: the incompatible type is defined here

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:1550:6: note: 'setIntEnabled' was previously declared here

 void MPU6050::setIntEnabled(uint8_t enabled) {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:1550:6: note: code may be misoptimized unless -fno-strict-aliasing is used

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:449:14: warning: 'setRate' violates the C++ One Definition Rule  [-Wodr]

         void setRate(uint8_t rate);

              ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:125:6: note: implicit this pointer type mismatch

 void MPU6050::setRate(uint8_t rate) {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.h:436:7: note: type 'struct MPU6050' itself violates the C++ One Definition Rule

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:436:7: note: the incompatible type is defined here

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:125:6: note: 'setRate' was previously declared here

 void MPU6050::setRate(uint8_t rate) {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:125:6: note: code may be misoptimized unless -fno-strict-aliasing is used

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:453:14: warning: 'setExternalFrameSync' violates the C++ One Definition Rule  [-Wodr]

         void setExternalFrameSync(uint8_t sync);

              ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:167:6: note: implicit this pointer type mismatch

 void MPU6050::setExternalFrameSync(uint8_t sync) {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.h:436:7: note: type 'struct MPU6050' itself violates the C++ One Definition Rule

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:436:7: note: the incompatible type is defined here

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:167:6: note: 'setExternalFrameSync' was previously declared here

 void MPU6050::setExternalFrameSync(uint8_t sync) {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:167:6: note: code may be misoptimized unless -fno-strict-aliasing is used

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:455:14: warning: 'setDLPFMode' violates the C++ One Definition Rule  [-Wodr]

         void setDLPFMode(uint8_t bandwidth);

              ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:210:6: note: implicit this pointer type mismatch

 void MPU6050::setDLPFMode(uint8_t mode) {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.h:436:7: note: type 'struct MPU6050' itself violates the C++ One Definition Rule

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:436:7: note: the incompatible type is defined here

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:210:6: note: 'setDLPFMode' was previously declared here

 void MPU6050::setDLPFMode(uint8_t mode) {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:210:6: note: code may be misoptimized unless -fno-strict-aliasing is used

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:459:14: warning: 'setFullScaleGyroRange' violates the C++ One Definition Rule  [-Wodr]

         void setFullScaleGyroRange(uint8_t range);

              ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:245:6: note: implicit this pointer type mismatch

 void MPU6050::setFullScaleGyroRange(uint8_t range) {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.h:436:7: note: type 'struct MPU6050' itself violates the C++ One Definition Rule

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:436:7: note: the incompatible type is defined here

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:245:6: note: 'setFullScaleGyroRange' was previously declared here

 void MPU6050::setFullScaleGyroRange(uint8_t range) {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:245:6: note: code may be misoptimized unless -fno-strict-aliasing is used

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:811:14: warning: 'writeProgMemoryBlock' violates the C++ One Definition Rule  [-Wodr]

         bool writeProgMemoryBlock(const uint8_t *data, uint16_t dataSize, uint8_t bank=0, uint8_t address=0, bool verify=true);

              ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:3152:6: note: implicit this pointer type mismatch

 bool MPU6050::writeProgMemoryBlock(const uint8_t *data, uint16_t dataSize, uint8_t bank, uint8_t address, bool verify) {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.h:436:7: note: type 'struct MPU6050' itself violates the C++ One Definition Rule

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:436:7: note: the incompatible type is defined here

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:3152:6: note: 'writeProgMemoryBlock' was previously declared here

 bool MPU6050::writeProgMemoryBlock(const uint8_t *data, uint16_t dataSize, uint8_t bank, uint8_t address, bool verify) {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:3152:6: note: code may be misoptimized unless -fno-strict-aliasing is used

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:810:14: warning: 'writeMemoryBlock' violates the C++ One Definition Rule  [-Wodr]

         bool writeMemoryBlock(const uint8_t *data, uint16_t dataSize, uint8_t bank=0, uint8_t address=0, bool verify=true, bool useProgMem=false);

              ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:3076:6: note: implicit this pointer type mismatch

 bool MPU6050::writeMemoryBlock(const uint8_t *data, uint16_t dataSize, uint8_t bank, uint8_t address, bool verify, bool useProgMem) {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.h:436:7: note: type 'struct MPU6050' itself violates the C++ One Definition Rule

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:436:7: note: the incompatible type is defined here

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:3076:6: note: 'writeMemoryBlock' was previously declared here

 bool MPU6050::writeMemoryBlock(const uint8_t *data, uint16_t dataSize, uint8_t bank, uint8_t address, bool verify, bool useProgMem) {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:3076:6: note: code may be misoptimized unless -fno-strict-aliasing is used

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:818:14: warning: 'setDMPConfig1' violates the C++ One Definition Rule  [-Wodr]

         void setDMPConfig1(uint8_t config);

              ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:3241:6: note: implicit this pointer type mismatch

 void MPU6050::setDMPConfig1(uint8_t config) {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.h:436:7: note: type 'struct MPU6050' itself violates the C++ One Definition Rule

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:436:7: note: the incompatible type is defined here

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:3241:6: note: 'setDMPConfig1' was previously declared here

 void MPU6050::setDMPConfig1(uint8_t config) {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:3241:6: note: code may be misoptimized unless -fno-strict-aliasing is used

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:822:14: warning: 'setDMPConfig2' violates the C++ One Definition Rule  [-Wodr]

         void setDMPConfig2(uint8_t config);

              ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:3251:6: note: implicit this pointer type mismatch

 void MPU6050::setDMPConfig2(uint8_t config) {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.h:436:7: note: type 'struct MPU6050' itself violates the C++ One Definition Rule

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:436:7: note: the incompatible type is defined here

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:3251:6: note: 'setDMPConfig2' was previously declared here

 void MPU6050::setDMPConfig2(uint8_t config) {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:3251:6: note: code may be misoptimized unless -fno-strict-aliasing is used

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:729:14: warning: 'setOTPBankValid' violates the C++ One Definition Rule  [-Wodr]

         void setOTPBankValid(bool enabled);

              ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:2826:6: note: implicit this pointer type mismatch

 void MPU6050::setOTPBankValid(bool enabled) {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.h:436:7: note: type 'struct MPU6050' itself violates the C++ One Definition Rule

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:436:7: note: the incompatible type is defined here

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:2826:6: note: 'setOTPBankValid' was previously declared here

 void MPU6050::setOTPBankValid(bool enabled) {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:2826:6: note: code may be misoptimized unless -fno-strict-aliasing is used

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:492:14: warning: 'setMotionDetectionThreshold' violates the C++ One Definition Rule  [-Wodr]

         void setMotionDetectionThreshold(uint8_t threshold);

              ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:523:6: note: implicit this pointer type mismatch

 void MPU6050::setMotionDetectionThreshold(uint8_t threshold) {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.h:436:7: note: type 'struct MPU6050' itself violates the C++ One Definition Rule

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:436:7: note: the incompatible type is defined here

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:523:6: note: 'setMotionDetectionThreshold' was previously declared here

 void MPU6050::setMotionDetectionThreshold(uint8_t threshold) {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:523:6: note: code may be misoptimized unless -fno-strict-aliasing is used

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:500:14: warning: 'setZeroMotionDetectionThreshold' violates the C++ One Definition Rule  [-Wodr]

         void setZeroMotionDetectionThreshold(uint8_t threshold);

              ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:593:6: note: implicit this pointer type mismatch

 void MPU6050::setZeroMotionDetectionThreshold(uint8_t threshold) {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.h:436:7: note: type 'struct MPU6050' itself violates the C++ One Definition Rule

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:436:7: note: the incompatible type is defined here

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:593:6: note: 'setZeroMotionDetectionThreshold' was previously declared here

 void MPU6050::setZeroMotionDetectionThreshold(uint8_t threshold) {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:593:6: note: code may be misoptimized unless -fno-strict-aliasing is used

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:496:14: warning: 'setMotionDetectionDuration' violates the C++ One Definition Rule  [-Wodr]

         void setMotionDetectionDuration(uint8_t duration);

              ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:553:6: note: implicit this pointer type mismatch

 void MPU6050::setMotionDetectionDuration(uint8_t duration) {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.h:436:7: note: type 'struct MPU6050' itself violates the C++ One Definition Rule

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:436:7: note: the incompatible type is defined here

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:553:6: note: 'setMotionDetectionDuration' was previously declared here

 void MPU6050::setMotionDetectionDuration(uint8_t duration) {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:553:6: note: code may be misoptimized unless -fno-strict-aliasing is used

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:504:14: warning: 'setZeroMotionDetectionDuration' violates the C++ One Definition Rule  [-Wodr]

         void setZeroMotionDetectionDuration(uint8_t duration);

              ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:624:6: note: implicit this pointer type mismatch

 void MPU6050::setZeroMotionDetectionDuration(uint8_t duration) {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.h:436:7: note: type 'struct MPU6050' itself violates the C++ One Definition Rule

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:436:7: note: the incompatible type is defined here

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:624:6: note: 'setZeroMotionDetectionDuration' was previously declared here

 void MPU6050::setZeroMotionDetectionDuration(uint8_t duration) {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:624:6: note: code may be misoptimized unless -fno-strict-aliasing is used

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:677:14: warning: 'setFIFOEnabled' violates the C++ One Definition Rule  [-Wodr]

         void setFIFOEnabled(bool enabled);

              ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:2343:6: note: implicit this pointer type mismatch

 void MPU6050::setFIFOEnabled(bool enabled) {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.h:436:7: note: type 'struct MPU6050' itself violates the C++ One Definition Rule

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:436:7: note: the incompatible type is defined here

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:2343:6: note: 'setFIFOEnabled' was previously declared here

 void MPU6050::setFIFOEnabled(bool enabled) {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:2343:6: note: code may be misoptimized unless -fno-strict-aliasing is used

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:798:14: warning: 'resetDMP' violates the C++ One Definition Rule  [-Wodr]

         void resetDMP();

              ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:3017:6: note: implicit this pointer type mismatch

 void MPU6050::resetDMP() {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.h:436:7: note: type 'struct MPU6050' itself violates the C++ One Definition Rule

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:436:7: note: the incompatible type is defined here

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:3017:6: note: 'resetDMP' was previously declared here

 void MPU6050::resetDMP() {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:3017:6: note: code may be misoptimized unless -fno-strict-aliasing is used

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:797:14: warning: 'setDMPEnabled' violates the C++ One Definition Rule  [-Wodr]

         void setDMPEnabled(bool enabled);

              ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:3014:6: note: implicit this pointer type mismatch

 void MPU6050::setDMPEnabled(bool enabled) {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.h:436:7: note: type 'struct MPU6050' itself violates the C++ One Definition Rule

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:436:7: note: the incompatible type is defined here

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:3014:6: note: 'setDMPEnabled' was previously declared here

 void MPU6050::setDMPEnabled(bool enabled) {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:3014:6: note: code may be misoptimized unless -fno-strict-aliasing is used

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:681:14: warning: 'resetFIFO' violates the C++ One Definition Rule  [-Wodr]

         void resetFIFO();

              ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:2383:6: note: implicit this pointer type mismatch

 void MPU6050::resetFIFO() {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.h:436:7: note: type 'struct MPU6050' itself violates the C++ One Definition Rule

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:436:7: note: the incompatible type is defined here

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:2383:6: note: 'resetFIFO' was previously declared here

 void MPU6050::resetFIFO() {

      ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:2383:6: note: code may be misoptimized unless -fno-strict-aliasing is used

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:613:17: warning: 'getIntStatus' violates the C++ One Definition Rule  [-Wodr]

         uint8_t getIntStatus();

                 ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:1679:9: note: implicit this pointer type mismatch

 uint8_t MPU6050::getIntStatus() {

         ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.h:436:7: note: type 'struct MPU6050' itself violates the C++ One Definition Rule

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:436:7: note: the incompatible type is defined here

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:1679:9: note: 'getIntStatus' was previously declared here

 uint8_t MPU6050::getIntStatus() {

         ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:1679:9: note: code may be misoptimized unless -fno-strict-aliasing is used

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:438:9: warning: '__comp_ctor ' violates the C++ One Definition Rule  [-Wodr]

         MPU6050(uint8_t address=MPU6050_DEFAULT_ADDRESS);

         ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:46:1: note: implicit this pointer type mismatch

 MPU6050::MPU6050(uint8_t address):devAddr(address) {

 ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.h:436:7: note: type 'struct MPU6050' itself violates the C++ One Definition Rule

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050.h:436:7: note: the incompatible type is defined here

 class MPU6050 {

       ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:46:1: note: '__comp_ctor ' was previously declared here

 MPU6050::MPU6050(uint8_t address):devAddr(address) {

 ^

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050\MPU6050.cpp:46:1: note: code may be misoptimized unless -fno-strict-aliasing is used

collect2.exe: error: ld returned 1 exit status

Multiple libraries were found for "I2C_16Bit.h"

 Used: C:\Users\blade\OneDrive\Documents\Arduino\libraries\Arduino-I2C-master

 Not used: C:\Users\blade\OneDrive\Documents\Arduino\libraries\I2C

exit status 1

Error compiling for board Arduino Nano.



This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

You still have two Arduino programs in the compile step.

Read the error messages very carefully to track down where, for example, setup() is defined more than once. Take note of file names in the error message and figure out where these programs are located.

By the way, this code won’t run on an AVR based 8-bit Arduino. It must have been written for something else with a default integer type of 32 bits, because this is a fatal mistake:

C:\Users\blade\OneDrive\Documents\Arduino\libraries\MPU6050/MPU6050_6Axis_MotionApps20.h:522:65: warning: integer overflow in expression [-Woverflow]

         - (int32_t)qI[2] * qI[2] + (int32_t)qI[3] * qI[3]) / (2 * 16384);

Forum members probably won’t be able to help unless you carefully document all the steps you have taken to get to this point.

If you are just beginning with Arduino, a project like this is NOT the place to start.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.