Skip to content

Conversation

@NoahVickerson
Copy link

Created the drivers for MS5611 and MS5607 Barometers

To test:

  • Create a loop that periodically gets samples from the barometers and logs/records them
  • Verify the readings are correct

To integrate:

  • include the required header file
  • declare an object of the class with the spi handle and required pins in the constructor
  • call getSample() to return a data structure containing temp and pressure readings

constexpr int CMD_TIMEOUT = 150;

// Barometer Commands (should not be modified, non-const due to HAL and C++ strictness)
static uint8_t ADC_D1_512_CONV_CMD = 0x42;

Choose a reason for hiding this comment

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

Is there a reason these are static? Can they not be constexpr?

Copy link
Author

Choose a reason for hiding this comment

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

HAL freaks out if they are const, although they should not be changed.

constexpr int CMD_TIMEOUT = 150;

// Barometer Commands (should not be modified, non-const due to HAL and C++ strictness)
static uint8_t ADC_D1_512_CONV_CMD = 0x42;

Choose a reason for hiding this comment

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

Same thing here, I believe these can be made constexpr.

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