Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
10 years, 7 months ago.
Can't compile: Error: A nonstatic member reference mu....
Hi everyone, I try to use a library for mpu5060. I create a new project with my main .cpp, I import my library mpu6050.h and .cpp. In mpu6050 i define my pin p9->sda and pin10->sdl for the I2C: MPU6050::MPU6050(PinName sda, PinName scl) : connection(p9, p10)
I come back to my main, and I just want to use function from the mpu6050.h like: getGyroRawZ( void );
But I got this error, I d'ont undertsand where it comes:
1 Answer
10 years, 7 months ago.
I don't know which specific MPU6050 lib you use, but here is an example of one (ignore that he commented half of the stuff out): http://mbed.org/users/ivanff15/code/sensor/file/4ed117a5e2e2/main.cpp. You normally shouldn't (need to) edit anything in the lib, and just make an object with the correct pins.