This is a basic driver for periodic measurements with the MPL3115A2 sensor connected to a Thunderboard Sense 2 (BRD4166A, EFR32MG12) board.
- IDE: Simplicity Studio Version: SV4.1.13.7
- SDK: Gecko SDK Suite: Bluetooth 2.13.4.0, version 2.7.4
- Compiler: GNU ARM v7.2.1
- Serial terminal: Realterm: Serial Capture Program 2.0.0.70
- Test hardware: SLTB004A Thunderboard Sense 2
I developed and tested in the Simplicity Studio IDE. I started with the soc-thunderboard project, then I removed the unnecessary parts and modified it for the MPL3115A2 sensor.
I logged some useful debug information and the measurements to the VCOM:
In the Altitude mode I can read the altitude in meter and the temperature in Celsius degree from the sensor:
In the Barometer mode I can read the pressure in Pascal and the temperature in Celsius degree from the sensor: