Trouble with MPU6050 code

Hi,

I’m a beginner and I’m working on MPIDE (it’s almost the same than Arduino IDE)…

I try to use this code :
https://mschoeffler.com/2017/10/05/tutorial-how-to-use-the-gy-521-module-mpu-6050-breakout-board-with-the-arduino-uno/

I’m working with an Arduino Chipkit (uno32) and a MPU6050 sensor. For now I didn’t change one thing from this code but it doesn’t work and I have a lot of compilation errors :

pr.cpp: In function ‘void setup()’:
pr.cpp:41:28: error: no matching function for call to ‘TwoWire::endTransmission(int)’
/Wire.h:51:13: note: candidate is: uint8_t TwoWire::endTransmission()
pr.cpp: In function ‘void loop()’:
pr.cpp:46:29: error: no matching function for call to ‘TwoWire::endTransmission(int)’
/Wire.h:51:13: note: candidate is: uint8_t TwoWire::endTransmission()
pr.cpp:47:39: error: no matching function for call to ‘TwoWire::requestFrom(const int&, int, int)’
/Wire.h:52:13: note: candidates are: uint8_t TwoWire::requestFrom(uint8_t, uint8_t)
/Wire.h:53:13: note: uint8_t TwoWire::requestFrom(int, int)

Could you help please :’(

It looks like you have a file called “pr.cpp” in the same folder as your sketch. There is a problem with that file so you should move it somewhere else if you want your sketch to compile. If you meant “pr.cpp” to be your Arduino sketch, rename it to “pr.ino”.

Thank you for your answer !

But it doesn’t seem to be the case because I have my sketch folder (called “pr”) and inside of it I have my project which is “pr.pde” (because I’m working with mpide)… Am I doing something wrong ?

Are you working on a “chipKIT” board and not an Arduino? When I look up “mpide” it seems to be for chipKIT. Perhaps the folks at https://chipkit.net/forum/ can help.

Yes indeed but I already have selected “Chipkit Uno 32” (tools --board). This software is supposed to be like Arduino
Thank you I will check it

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