-
Notifications
You must be signed in to change notification settings - Fork 851
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
MPU6050 i2c example expanded into library #504
base: develop
Are you sure you want to change the base?
Conversation
Thanks. I have a so far untested MPU6050, I'll give it a go. |
Presumably this also fixes / supersedes the issues identified with the current example code? https://github.com/raspberrypi/pico-examples/issues?q=is%3Aopen+MPU6050 |
@lurch , |
I've pushed some changes to improve it, including adding a test that demonstrates scaling with the C++ library. Unfortunately, my pico has stopped working, so I can't test it myself. |
fixed my pico, then fixed the code. |
@peterharperuk thanks for waiting, I've marked this PR as ready. I'm still unsure of the best way to integrate this into the repo. Should I wrap the C++ section to check for compilers without C++? |
Can you please squash all your change into one commit? For some reason I can't seem to checkout your changes. |
08a6c00
to
f789446
Compare
@peterharperuk I rebased and squashed. The develop_rebased branch has the commit history if that becomes easier to checkout. |
f789446
to
5c1fcab
Compare
@peterharperuk figured it out, my editor had been adding CRLF instead of LF. Sorry about that! I've rebased my master branch, that should be usable now. |
@NirajPatelRobots This PR has ballooned back up to 12 separate commits again 😕 |
5c1fcab
to
f7a3659
Compare
@lurch sorry about that, I've re-squashed it. |
I refactored and expanded the mpu6050_i2c example. This adds new functions for MPU6050 features and clarifies existing ones. It also refactors the example into an MPU6050_i2c library and main.c. There are C and C++ versions of the library. I've been using the C++ library in another project for around a year.
I realize that this is a pretty drastic change, and moves the code away from its original intent as a pico code example. I plan on separating this into a dedicated mpu6050_i2c pico library. However, some of these changes could be useful for the pico-examples repo. Some possibilities are:
I'm happy to include any suggestions you have.