0

I tried to test the MPU6050 example on https://maker.pro/arduino/tutorial/how-to-interface-arduino-and-the-mpu-6050-sensor, but run into a number of compiler errors like these:

In file included from C:\Users\Thimo\AppData\Local\Temp\arduino_modified_sketch_323002\MPU6050_DMP6.ino:56:0:

D:\Users\Thimo\Documents\Arduino\libraries\MPU6050/MPU6050_6Axis_MotionApps20.h:69:26: error: conflicting declaration 'typedef uint32_t prog_uint32_t'

         typedef uint32_t prog_uint32_t;

                          ^

In file included from C:\Users\Thimo\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\cores\esp32/WString.h:29:0,

                 from C:\Users\Thimo\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\cores\esp32/Arduino.h:146,

                 from sketch\MPU6050_DMP6.ino.cpp:1:

C:\Users\Thimo\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\cores\esp32/pgmspace.h:30:23: note: previous declaration as 'typedef long unsigned int prog_uint32_t'

 typedef unsigned long prog_uint32_t;

                       ^

exit status 1
Fout bij het compileren voor board WEMOS LOLIN32

Found a similar issue on github with a solution to remove some lines in the library file MPU6050_6Axis_MotionApps20.h, but then another error pops up:

D:\Users\Thimo\Documents\Arduino\libraries\I2Cdev\I2Cdev.cpp: In static member function 'static int8_t I2Cdev::readBytes(uint8_t, uint8_t, uint8_t, uint8_t*, uint16_t)':

D:\Users\Thimo\Documents\Arduino\libraries\I2Cdev\I2Cdev.cpp:276:62: error: 'BUFFER_LENGTH' was not declared in this scope

             for (uint8_t k = 0; k < length; k += min(length, BUFFER_LENGTH)) {

                                                              ^

D:\Users\Thimo\Documents\Arduino\libraries\I2Cdev\I2Cdev.cpp: In static member function 'static int8_t I2Cdev::readWords(uint8_t, uint8_t, uint8_t, uint16_t*, uint16_t)':

D:\Users\Thimo\Documents\Arduino\libraries\I2Cdev\I2Cdev.cpp:414:70: error: 'BUFFER_LENGTH' was not declared in this scope

             for (uint8_t k = 0; k < length * 2; k += min(length * 2, BUFFER_LENGTH)) {

                                                                      ^

exit status 1
Fout bij het compileren voor board WEMOS LOLIN32

Again, an error within a library file... What am I doing wrong? @FjodorvanSlooten, I used the libraries you provided on slack, but still the same errors appear.

Share a link to this question (includes your user id)
| edit | | close | delete |
1

Did you save the sketch under Documents\Arduino...? As I see references to C:\Users\xxxxxxxx\AppData\Local\Temp\arduino_modified_sketch_323002\MPU6050_DMP6.ino

One other thing: are you trying to compile it for board WEMOS LOLIN32? The note at the bottom "Fout bij het compileren voor board WEMOS LOLIN32" seems to suggest this... This might not work either as these sketches (and the i2cdev library also) are made for a regular Arduino Uno/Nano...

Share a link to this answer (includes your user id)
| edit | delete |
  • Well... that explains a lot hah. Didn't see the Nano at first, but it definitely is in the kit. It's working now, although I am getting some weird characters in the serial monitor when it's reading the sensor. $?⸮$?⸮. The MPU6050_tockn example works fine, and gives reasonable (and readable) values – Thimo Willems Apr 4 at 13:40    
  • @ThimoWillems Weird characters might occur if the speed in the Serial Monitor does not match the speed set in the sketch with Serial.begin(...) – Fjodor van Slooten Apr 4 at 14:05    

Your Answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.