Search the Community
Showing results for tags 'error'.
-
i imported i2cdev.h and mpu6050.h library. But it doesnt work. Help me please. Error code; MPU6050.cpp:1997:6: error: prototype for 'bool MPU6050::getMotionStatus()' does not match any in class 'MPU6050' bool MPU6050::getMotionStatus() { ^ In file included from MPU6050.cpp:37:0: C:\Users\ziya.ozcelik\Documents\Arduino\libraries\MPU6050/MPU6050.h:611:17: error: candidate is: uint8_t MPU6050::getMotionStatus() uint8_t getMotionStatus();
-
Hello, dear pro MPU users! :-) I have no problem to compile the example for Arduino. This is good :-) But I can't move all the initializations and all the serial output into new class, I called Sensor. I'v created Sensor.h, Sensor.cpp In the sensor.h: #ifndef SENSOR_H #define SENSOR_H #include "I2Cdev.h" #include "MPU6050_6Axis_MotionApps20.h" //#include "MPU6050.h" // not necessary if using MotionApps include file // Arduino Wire library is required if I2Cdev I2CDEV_ARDUINO_WIRE implementation // is used in I2Cdev.h #if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE #include "Wire.h" #endif class Sensor{ public: static Sensor & getInstance(){ static Sensor instance; return instance; } bool init(); bool getYpr(float & y, float & p, float r); protected: MPU6050 _mpu; .................................. ...................... ........... In the main project: #include "Wire.h" #include "sensor.h" void setup() { Sensor::getInstance().init(); } void loop() { float y,p,r; Sensor::getInstance().getYpr(y,p,r); } And I have a lot of errors like this: I'v found some information, that this may be caused by including "MPU6050.h", but I don't do it! I can't attach archives here. So, here is a link to a dropbox with my test project: https://dl.dropboxusercontent.com/u/51786067/testMPU.rar Hope, my question is not very stupid :-) Thanks!
- 4 replies
-
- multiple definition
- MPU6050
-
(and 1 more)
Tagged with:
-
Hi All, I recently purchased the MPU-6050 6-axis accel from amazon for an awesome price. I connected everything per the documents provided and ran some sample code also provided on the I2C website. I am fairly new to this but if there were documents guiding me I am quick to learn. When I open the Serial Monitor window at the correct baudrate, I get "error = 2". I have no idea what this means, or where to go to guide me on how to resolve this. Has anyone seen this before or know where/how I can troubleshoot this? Any help would be greatly appreciated. Thanks everyone! emerjer