Skip to content

Add example for MPL3115A2 altimeter #136

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

Merged
merged 11 commits into from
Oct 14, 2021
Merged

Add example for MPL3115A2 altimeter #136

merged 11 commits into from
Oct 14, 2021

Conversation

matiasilva
Copy link

@matiasilva matiasilva commented Jul 12, 2021

This PR adds an example for the MPL3115A2 altimeter with absolute pressure + temp sensor. To add some variety to the sea of pressure/temp sensors, this example demonstrates some of the more advanced features of this board and its different modes.

Checklist

  • documentation
  • working example
  • Fritzing schematic and image
  • added to CMakeLists.txt
  • added to repo README

@aallan aallan added the enhancement New feature or request label Jul 12, 2021
@matiasilva matiasilva marked this pull request as ready for review July 14, 2021 13:32
@aallan
Copy link

aallan commented Aug 3, 2021

Where are we on this, are we ready to pass it to @kilograham for a final review? @lurch opinions?

hsum += data.altitude;
}
printf("%d sample average -> t: %.4f C, h: %.4f m\n", MPL3115A2_FIFO_SIZE, tsum / MPL3115A2_FIFO_SIZE, hsum / MPL3115A2_FIFO_SIZE);
has_new_data = false;
Copy link
Collaborator

Choose a reason for hiding this comment

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

There's no mutex protection on the has_new_data variable and it is set in the interrupt routine and tested here. However, its likely OK in this simple case.

@JamesH65
Copy link
Collaborator

JamesH65 commented Sep 2, 2021

I had one comment about a variable accessed in interrupt and main thread domain, but @kilograham may be OK with it. Otherwise LGTM.

@aallan aallan changed the base branch from develop to merge-intern-examples October 14, 2021 09:16
@aallan aallan merged commit 04a1e58 into raspberrypi:merge-intern-examples Oct 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants