Hummingbird Flight Software
Flight software for the Hummingbird FCU quadcopter flight controller. Designed to run on the Teensy 4.1. Developed with VSCode+PlatformIO.
Public Member Functions | Public Attributes | Private Attributes | List of all members
BMP388Baro Class Reference

This is driver code for the BMP388 temp/pres sensor. More...

#include <bmp388_barometer.h>

Inheritance diagram for BMP388Baro:

Public Member Functions

 BMP388Baro (TwoWire *wireInput=&SENSOR_I2C)
 This is driver code for the BMP388 temp/pres sensor. More...
 
bool Initialize (uint8_t presOS=BMP3_NO_OVERSAMPLING, uint8_t tempOS=BMP3_NO_OVERSAMPLING, uint8_t iirCoef=BMP3_IIR_FILTER_COEFF_3, uint8_t odr=BMP3_ODR_50_HZ)
 Use Adafruit's BMP388 library to configure the BMP388. More...
 
bool ReadSensor ()
 Use Adafruit's BMP388 library to read temperature and pressure registers. More...
 
float GetPressure ()
 Return atmospheric pressure in [Pa]. More...
 
float GetTemperature ()
 Return atmospheric temperature in [C]. More...
 

Public Attributes

uint32_t prevMeasMicros
 

Private Attributes

bool connected
 
float _t
 
float _p
 
TwoWire * _SensorWire
 

Detailed Description

This is driver code for the BMP388 temp/pres sensor.

It also incorporates Adafruit's BMP388 driver code.

Constructor & Destructor Documentation

◆ BMP388Baro()

BMP388Baro::BMP388Baro ( TwoWire *  wireInput = &SENSOR_I2C)

This is driver code for the BMP388 temp/pres sensor.

It also incorporates Adafruit's BMP388 driver code. Create BMP388 pressure and temperature sensor object.

Parameters
wireInputWire/I2C interface that the sensor is connected to.

Member Function Documentation

◆ GetPressure()

float BMP388Baro::GetPressure ( )

Return atmospheric pressure in [Pa].

Returns
Pressure in [Pa]

◆ GetTemperature()

float BMP388Baro::GetTemperature ( )

Return atmospheric temperature in [C].

Returns
Temperature in [C]

◆ Initialize()

bool BMP388Baro::Initialize ( uint8_t  presOS = BMP3_NO_OVERSAMPLING,
uint8_t  tempOS = BMP3_NO_OVERSAMPLING,
uint8_t  iirCoef = BMP3_IIR_FILTER_COEFF_3,
uint8_t  odr = BMP3_ODR_50_HZ 
)

Use Adafruit's BMP388 library to configure the BMP388.

Take a few readings to 'flush out' bad data. The input config. param. definitions can be found in lib/Adafruit_BMP3XX/Adafruit_BMP3XX.h

Parameters
presOSPressure oversampling factor.
tempOSTemperature oversampling factor.
iirCoefIIR filter coef. for smoothing out data.
odrOutput data rate.
Returns
True if good reading, false if error.

◆ ReadSensor()

bool BMP388Baro::ReadSensor ( )

Use Adafruit's BMP388 library to read temperature and pressure registers.

Returns
True if good reading, false if error.

Member Data Documentation

◆ _p

float BMP388Baro::_p
private

◆ _SensorWire

TwoWire* BMP388Baro::_SensorWire
private

◆ _t

float BMP388Baro::_t
private

◆ connected

bool BMP388Baro::connected
private

◆ prevMeasMicros

uint32_t BMP388Baro::prevMeasMicros

The documentation for this class was generated from the following files: