Skip to content

"MPU6050_6Axis_MotionApps_V6_12.h" and "newly added calibration code using PID in MPU6050.cpp" make compilation error. #450

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kmg3821 opened this issue Jul 13, 2019 · 7 comments

Comments

@kmg3821
Copy link

kmg3821 commented Jul 13, 2019

There are quite a lot of mismatches for data type. For instance, in "MPU6050_6Axis_MotionApps_V6_12.h",

I2Cdev::writeBit(devAddr,0x6B, 7, &(val = 1));
--> Last parameter's data type is _uint8_t*

However, in the latest version of "I2Cdev.h",

static bool writeBit(uint8_t devAddr, uint8_t regAddr, uint8_t bitNum, uint8_t data);
--> It must be _uint8_t.

Is there any solution for this problem without changing corresponding data type?

right now, I've removed the code which was making error. Then, works!

I think those should be written with MPU6050.cpp functions.

@kmg3821 kmg3821 changed the title "MPU6050_6Axis_MotionApps_V6_12.h" and "newly added calibration code in MPU6050.cpp" make compile error. "MPU6050_6Axis_MotionApps_V6_12.h" and "newly added calibration code in MPU6050.cpp" make compilation error. Jul 13, 2019
@kmg3821 kmg3821 changed the title "MPU6050_6Axis_MotionApps_V6_12.h" and "newly added calibration code in MPU6050.cpp" make compilation error. "MPU6050_6Axis_MotionApps_V6_12.h" and "newly added calibration code using PID in MPU6050.cpp" make compilation error. Jul 13, 2019
@intensite
Copy link

Having similar problem with Arduino IDE when trying to compile MPU6050_DMP_using_DMP_V6.12


Arduino: 1.8.8 (Windows 10), Board: "Arduino/Genuino Uno"

C:\Users\stephen\AppData\Local\Temp\arduino_modified_sketch_788500\MPU6050_DMP6_using_DMP_V6.12.ino: In function 'void setup()':

MPU6050_DMP6_using_DMP_V6.12:217:13: error: 'class MPU6050' has no member named 'CalibrateAccel'

         mpu.CalibrateAccel(6);

             ^

MPU6050_DMP6_using_DMP_V6.12:218:13: error: 'class MPU6050' has no member named 'CalibrateGyro'

         mpu.CalibrateGyro(6);

             ^

MPU6050_DMP6_using_DMP_V6.12:220:13: error: 'class MPU6050' has no member named 'PrintActiveOffsets'

         mpu.PrintActiveOffsets();

             ^

exit status 1
'class MPU6050' has no member named 'CalibrateAccel'



@jrowberg
Copy link
Owner

As long as you have the latest code from the master branch (particularly the /Arduino/MPU6050/* files), this should no longer happen.

@intensite
Copy link

Same issue with ESP32 :(

'class MPU6050' has no member named 'PrintActiveOffsets'

What is the date of the changelog on top of your MPU6050.cpp file ?

Mine is this and it works:

Changelog:
//  2019-07-08 - Added Auto Calibration routine

I struggled a lot to make it work in a custom C++ class on a ESP32 but now it is pretty good.

@bart
Copy link

bart commented Apr 3, 2020

Thanks a lot for your fast reply @intensite !

I moved folders I2Cdev and MPU6050 from Arduino folder into my custom libraries folder. When executing DMP 6.12 example I'm getting typedef unsigned long prog_uint32_t; error for ESP32 board. So what I did was replacing custom lib files with files from ESP32_ESP-IDF/components which seems like they not include all necessary methods. Must I use the ESP32_ESP-IDF folder in a different way?

@bart
Copy link

bart commented Apr 3, 2020

Got it working now with DMP6 demo instead. Had to do some changes like described here: #367 But instead of adapting I2Cdev.cpp change file MPU6050.cpp instead.

@intensite
Copy link

Yes I recall seing this. I probably applied this change early on but just didn't remember.
What do you use for I2CDEV_IMPLEMENTATION? I was never able to use anything else than the standard "Wire.h" with the ESP32. I use it like this

Wire.begin(SDA, SCL, 400000);

@bart
Copy link

bart commented Apr 3, 2020

It uses the default here for I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE which is just a Wire.begin();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants