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

Read scaled output values using set gyro and acceleromter ranges #9

Merged
merged 8 commits into from
May 2, 2024

Conversation

avsaase
Copy link
Contributor

@avsaase avsaase commented May 1, 2024

This builds on #8 to add function that returns the scaled output values for the set gyro and accelerometer range.

I don't fully understand the testing setup used in this repo so I didn't add any tests. I'm happy to add some if you can give some guidance on what you want tested.

Closes #8

@avsaase avsaase changed the title Read scaled Read scaled output values using set gyro and acceleromter ranges May 1, 2024
Copy link
Owner

@eldruin eldruin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thank you!
For the tests, I would like to see tests for the set_accel_range and set_gyro_range so that it is checked that providing each variant results in an adequate register write.
I think you can copy the code highlighted here into a new range.rs file and adapt it.
For getting the data scaled, I would like to have a test that looks like this one but the values are scaled according to the ranges set.

README.md Show resolved Hide resolved
src/device_impl.rs Outdated Show resolved Hide resolved
src/device_impl.rs Outdated Show resolved Hide resolved
@avsaase
Copy link
Contributor Author

avsaase commented May 2, 2024

I addressed your review comments and also the the ones from #8. I think it makes sense to let this PR replace the other one.

@eldruin eldruin merged commit 0a68bc7 into eldruin:master May 2, 2024
22 checks passed
@eldruin
Copy link
Owner

eldruin commented May 2, 2024

Thank you! I have merged this now and released it in version 1.1.0.

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

Successfully merging this pull request may close these issues.

3 participants