mpu9250 i2c connection doesn't work

asad

Active member
hello
the example of the mpu9250 library give me error when compiling i dont know why ... can u help?
/* * Brian R Taylor * brian.taylor@bolderflight.com * * Copyright (c) 2021 Bolder Flight Systems Inc * * 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 "mpu9250.h" /* Mpu9250 object */ bfs::Mpu9250 imu; void setup() { /* Serial to display data */ Serial.begin(115200); while(!Serial) {} /* Start the I2C bus */ Wire2.begin(); Wire2.setClock(400000); /* I2C bus, 0x68 address */ imu.Config(&Wire2, bfs::Mpu9250::I2C_ADDR_PRIM); /* Initialize and configure IMU */ if (!imu.Begin()) { Serial.println("Error initializing communication with IMU"); while(1) {} } /* Set the sample rate divider */ if (!imu.ConfigSrd(19)) { Serial.println("Error configured SRD"); while(1) {} } } void loop() { /* Check if data read */ if (imu.Read()) { Serial.print(imu.new_imu_data()); Serial.print("\t"); Serial.print(imu.new_mag_data()); Serial.print("\t"); Serial.print(imu.accel_x_mps2()); Serial.print("\t"); Serial.print(imu.accel_y_mps2()); Serial.print("\t"); Serial.print(imu.accel_z_mps2()); Serial.print("\t"); Serial.print(imu.gyro_x_radps()); Serial.print("\t"); Serial.print(imu.gyro_y_radps()); Serial.print("\t"); Serial.print(imu.gyro_z_radps()); Serial.print("\t"); Serial.print(imu.mag_x_ut()); Serial.print("\t"); Serial.print(imu.mag_y_ut()); Serial.print("\t"); Serial.print(imu.mag_z_ut()); Serial.print("\t"); Serial.print(imu.die_temp_c()); Serial.print("\n"); } }


the error is "
In file included from C:\Users\engah\AppData\Local\Temp\.arduinoIDE-unsaved2024125-20408-1g1wkg2.sp2j\i2c\i2c.ino:26:
c:\Users\engah\Documents\Arduino\libraries\Bolder_Flight_Systems_MPU9250\src/mpu9250.h:38:10: fatal error: eigen.h: No such file or directory
38 | #include "eigen.h" // NOLINT
| ^~~~~~~~~
compilation terminated.
exit status 1

Compilation error: exit status 1'
 
Back
Top