Closed froussel closed 1 year ago
`/* Go to your SparkFun library (this is usually Documents\Arduino\libraries\SparkFun_MPU-9250-DMP_Arduino_Library-master) navigate to src\util and edit the file inv_mpu.h Somewhere at the beginning of file, just below the line that says
add the following line:
and the library is good for ESP266 and ESP32
now with ESP8266 Wemos D1 Mini
février 2022
MPU9250 ESP8266
VCC 3.3v
GND GND
SCL/SCLK D1 SCL
SDA D2 SDA
Ecran :UC1701x
5 LedA vers 3.3v
6 Vss GND
7 Vdd 3.3v
8 SCLK D5 SCK GPIO14
9 SDA D7 MOSI GPIO13
10 RS D4 dc GPIO 2
11 Reset D3 reset GPIO 0
12 CS D8 GPIO 15 /
//#include
//U8G2_UC1701_MINI12864_F_4W_SW_SPI u8g2(U8G2_R2, / clock=D5/ 14, / data=D7/ 13, / cs=D8/ 15, / dc=D2/ 2, / reset=D3*/ 0 ); // ^=================== MPU9250_DMP imu; void compas1(void){ if (imu.begin() != INV_SUCCESS) { Serial.println("imu.begin() Failed!"); while (1) { Serial.println("Unable to communicate with MPU-9250"); Serial.println("Check connections, and try again."); Serial.println(); delay(5000); } } Serial.println("imu.begin() succeeded"); imu.dmpBegin(DMP_FEATURE_6X_LP_QUAT | // Enable 6-axis quat DMP_FEATURE_GYRO_CAL, // Use gyro calibration 10); // Set DMP FIFO rate to 10 Hz Serial.println("setup() completed"); compas2(); } void compas2(void){ byte boucle =0; while (boucle == 0) { delay(10); if (imu.fifoAvailable()) { if (imu.dmpUpdateFifo() == INV_SUCCESS) { delay(10); imu.computeEulerAngles(); Serial.println("R/P/Y: " + String(imu.roll) + ", " + String(imu.pitch) + ", " + String(imu.yaw)); } } } } void setup(void) { Serial.begin(115200); //u8g2.begin(); <==================== Wire.begin(); compas1(); } void loop(void) { delay(10); } https://github.com/sparkfun/SparkFun_MPU-9250-DMP_Arduino_Library
This sketch works but if we uncomment
In its library anymore and I think it's her who is at fault line if (imu.begin() != INV_SUCCESS) is the cause and if I go to the SparkFunMPU9250-DMP.h library it's on line 46 result = mpu_init(&int_param); which reboots mpu_init is in inv_mpu.c Then I don't know how to track Thanks for you help
Extremely simple: I forgot #define
Hello,
I use
include
include
include
include
include
include "OneButton.h"
if I run screen u2g2lib, chrono, onebutton in first : no problem After ESP8266 wemos D1 mini reboot with result = mpu_init(&int_param); in SparkFunMPU9250-DMP.cpp
what is the solution please ?
SparkFunMPU9250-DMP.cpp