MeGyro acceleration data


#1

It’s a “Me 3-Axis Accelerometer and Gyro Sensor” but the MeGyro example only explains the gyro part of this module. There doesn’t seem to be any examples for how to use the accelerometer part. Also looking at the makeblock.cpp file doesn’t give me much information because there are 0 comments for these methods:

void MeGyro::calibrate()
void MeGyro::update()
int MeGyro::readData(int start, uint8_t *buffer, int size)
int MeGyro::writeData(int start, const uint8_t *pData, int size)
int MeGyro::writeReg(int reg, uint8_t data)

What are these methods for? Can I use them?

Ultimately I want to estimate/track my robot’s position in space as it moves around. So angleX, angleY, angleZ methods have very limited use for me. Can I use this readData method somehow? How should I interprete the data?

Some tips would be great, a real example and additions to the API would be excellent.


#2

Hi @Kaarel_Lumi

Could you try the third party library? https://github.com/jrowberg/i2cdevlib/tree/master/Arduino, you could find the MPU6050 example in it.


#3

Thanks. I will take a look at it.


#4