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 minimal BNO055 driver #191

Merged
merged 3 commits into from
Jul 11, 2019
Merged

Conversation

salkinium
Copy link
Member

Adds a minimal implementation of the BNO055 driver, which only reads the results array in full NDOF mode.

src/modm/platform/i2c/stm32/module.lb Outdated Show resolved Hide resolved
/// Constructor, requires a bno055::Data object.
/// For I2c this also sets the address to 0b110101 (alternative: 0x1C).
inline Bno055(Data &data, uint8_t address=addr()):
I2cDevice<I2cMaster,2>(address), data(data) {}
Copy link
Member

@dergraaf dergraaf Apr 10, 2019

Choose a reason for hiding this comment

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

data(data) is very error prune, as the compiler will still be happy if you rename the argument but don't change this line. I suggest either an m prefix for the member (what I've been using lately) or an _ suffix for the parameter, that seem to be the most popular options. Or rename either of the two to something different.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I’d like to use the Qt coding conventions in general: m_ prefix and just obj.data() as getter. But, yeah, conventions…

src/modm/driver/inertial/bno055.hpp Outdated Show resolved Hide resolved
@salkinium salkinium merged commit a8edbe8 into modm-io:develop Jul 11, 2019
@salkinium salkinium deleted the feature/bno055 branch July 11, 2019 22:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants