Problem with mpu9250 library

Hi everyone, i have a problem when a try to compile a sketch, its not mine. I tried a lot of similar programs but the same error stay.

This is my program

#include <Wire.h>
#include <mpu9250.h>






mpu9250 IMU(wire , 0x68);

void setup() {
  // put your setup code here, to run once:
Serial.begin(9600);
IMU.begin();
}

void loop() {
 //acelerometer data code
Serial.print("Accelerometer X axis: ");
Serial.print(IMU.getAcce1X_mss(), 3);
Serial.print("                Accelerometer y axis: ");
Serial.print(IMU.getAcce1Y_mss(),  3);
Serial.print("                Accelerometer Z axis: ");
Serial.print(IMU.getAcce1Z_mss(),  3);
//Gyroscope data code
Serial.print("Gyroscope X axis(radians): ");
Serial.print(IMU.getGyroX_rads(),  3);
Serial.print("                Gyroscope Y axis(radians): ");
Serial.print(IMU.getGyroY_rads(),  3);
Serial.print("                Gyroscope Z axis(radians): ");
Serial.print(IMU.getGyroZ_rads(),  3);
//magnetometer data code
Serial.print("Magnetometer X axis(microtesla): ");
Serial.print(IMU.getMagX_uT(),  3);
Serial.print("                 Magnometer Y axis(microtesla): ");
Serial.print(IMU.getMagY_uT(),  3);
Serial.print("                  Magnometer Z axis(microtesla): ");
Serial.print(IMU.getMagZ_uT(),  3);
//Temperature reading
Serial.print("Temperature: ");
Serial.println(IMU.getTemperature_C(),  2);
Serial.print( "************* Next buffer data****************");
Serial.println("            ");
Serial.println("            ");
Serial.println("            ");



}

exit status 1

Compilation error: 'mpu9250' does not name a type

i dont know where its the problem, because the library its correct, i use "Bolder_Flight_Systems_MPU9250" i hope someone can help me with that.

Take a look at the example programs and documentation for that particular library to see how it is used.

The code you posted was probably written for a different library (there are many of that name).

1 Like

If you link where you acquired the code, there may be a reference to the library originally used.

1 Like

Yeah, i look in the library and i found a better code, sorry about that. beginner mistake i guess

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