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 Lsm303agr Accel/Mag driver #607

Merged
merged 6 commits into from
Apr 13, 2023
Merged

Add Lsm303agr Accel/Mag driver #607

merged 6 commits into from
Apr 13, 2023

Conversation

adrianstevens
Copy link
Contributor

No description provided.

@@ -0,0 +1,12 @@
namespace Meadow.Foundation.Sensors.Accelerometers
{
public partial class Lsm303agr
Copy link
Contributor

Choose a reason for hiding this comment

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

Any particular reason these registers are public?

Copy link
Collaborator

Choose a reason for hiding this comment

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

its a partial class, but the registers are not public

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah they're not public - partial public class but the fields are private

/// </summary>
void Initialize()
{
i2cPeripheralAccel.WriteRegister(ACC_CTRL_REG1_A, 0x57);
Copy link
Contributor

Choose a reason for hiding this comment

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

minor nit, but these should probably be defined constants instead of magic numbers

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah it's a compound value setting things up .... I could easily move it up. I often do this for init methods because they do end up with a crap ton of magic init values. Displays are terrible for it and it doesn't quite seem worth the hassle of creating 20ish defines.

@adrianstevens adrianstevens merged commit bece89c into develop Apr 13, 2023
@adrianstevens adrianstevens deleted the Lsm303agr branch April 13, 2023 16:15
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