Skip to content
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

Magnetometer reading #4

Closed
Electricaz opened this issue May 31, 2018 · 0 comments
Closed

Magnetometer reading #4

Electricaz opened this issue May 31, 2018 · 0 comments

Comments

@Electricaz
Copy link

Electricaz commented May 31, 2018

Thank you for the great code, very helpful.
I’ve been trying to read magnetometer from MPU9255 but no luck, readings are 0 and would appreciate your support.
Gyroscope and Accelerometer working fine.
here is the

MPU.acceleration(&accelRaw);  // fetch raw data from the 
MPU.rotation(&gyroRaw);       // fetch raw data from the 
MPU.heading(&compassRaw);
MPU.motion(&accelRaw, &gyroRaw, &compassRaw);
float mx = compassRaw[0] * 1.499;
float my = compassRaw[1] * 1.499;
float mz = compassRaw[2] * 1.499;
printf("mx = %f \t my = %f \t mz = %f\n",mx,my,mz);
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

1 participant