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

Add MPU6886 driver #552

Open
ivoszz opened this issue Apr 24, 2023 · 1 comment
Open

Add MPU6886 driver #552

ivoszz opened this issue Apr 24, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@ivoszz
Copy link
Contributor

ivoszz commented Apr 24, 2023

I want to add M5Stick-C to tinygo as a supported platform with its MPU6886 (also M5Stack Core/Core2) accelerometer/gyroscope as a driver. I started by adding basic functions of the driver based on the MPU6050. But I found that I don't quite understand the concept of the return values of the ReadAcceleration() and ReadRotation() functions. These functions do not work with sensitivity settings (e.g. +/- 2g, 4g, 8g, 16g) and always return scaled raw counter values. So if I set the sensitivity to 16g, the return values are not in the range +/- 1000000, but approximately +/- 125000. Is it then up to the user to scale the result correctly?

I am able to add basic functionality in a short time. But MPU6050 doesn't seem like an ideal model to me, is it possible to recommend some other accelerometer/gyroscope unit? I would like to add more advanced features like using FIFO or IRQ later. Is there a good example? I'm not very good at naming variables and functions and a template would come in handy.

I've read the terms and conditions for contributing, is there anything I should pay particular attention to?

Thanks for any suggestions.

@soypat
Copy link
Contributor

soypat commented Apr 29, 2023

Yes, the existing mpu6050 driver is extremely limited. Please refer to the rewrite here #556 for a more ideal approach to implementing future IMU drivers.

This implementation does not have FIFO or IRQ but could possibly be extended.

@deadprogram deadprogram added the enhancement New feature or request label May 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants