High resolution barometer and altimeter using i2c mode
Dependents: upverter_fitbit_clone ReadingMag_HMC5883L_work
ms5611 Class Reference
Create ms5611 controller class. More...
#include <ms5611.h>
Public Member Functions | |
ms5611 (PinName sda, PinName scl) | |
Create a MS5611 object using the specified I2C object
| |
ms5611 (PinName sda, PinName scl, CSBpolarity CSBpin) | |
Create a MS5611 object using the specified I2C object
| |
void | cmd_reset () |
Initialize the MS5611 and set up the coefficients First - reset the MS5611 Second - load coefficient values from the MS5611 PROM Third - calculate coefficient checksum This routine only needs to be run once at boot up. | |
double | calcTemp () |
Calculate and return compensated temperature Returns double temperature in degC. | |
double | calcPressure () |
Calculate and return compensated barometric pressure Returns double pressure in millibars. | |
double | getPressure () |
Return compensated barometric pressure Returns double pressure in millibars DOES NOT RE-CALCULATE FIRST!!! Saves time if you calcTemp(); first. | |
float | getAltitudeFT (float sea_pressure) |
Calculate and returns altitude in feet Returns float altitude in feet. | |
float | getSeaLevelBaroFT (float known_alt) |
Calculate and returns sea level baro Returns float seal level barometer in feet. | |
float | getSeaLevelBaroM (float known_alt) |
Calculate and returns sea level baro Returns float seal level barometer in meters. |
Detailed Description
Create ms5611 controller class.
- Parameters:
-
ms5611 class
Definition at line 101 of file ms5611.h.
Constructor & Destructor Documentation
ms5611 | ( | PinName | sda, |
PinName | scl | ||
) |
Create a MS5611 object using the specified I2C object
- User fixed I2C address 0xEE, CSB pin = 0
- This is the default legacy constructor.
- Parameters:
-
sda - mbed I2C interface pin scl - mbed I2C interface pin
Definition at line 29 of file ms5611.cpp.
ms5611 | ( | PinName | sda, |
PinName | scl, | ||
CSBpolarity | CSBpin | ||
) |
Create a MS5611 object using the specified I2C object
- User defined use of the CSB pin
- CSB pin = 0, user set I2C address to 0xEE
- CSB pin = 1, user set I2C address to 0xEC.
- Parameters:
-
sda - mbed I2C interface pin scl - mbed I2C interface pin ms5611::CSBpin_0 - CSB pin tied to ground ms5611::CSBpin_1 - CSB pin tied to VDD
Definition at line 38 of file ms5611.cpp.
Member Function Documentation
double calcPressure | ( | ) |
Calculate and return compensated barometric pressure Returns double pressure in millibars.
calculate pressure
- Parameters:
-
NONE
- Returns:
- double barometric pressure millibar
Definition at line 342 of file ms5611.cpp.
double calcTemp | ( | ) |
Calculate and return compensated temperature Returns double temperature in degC.
calculate temperature
- Parameters:
-
NONE
- Returns:
- double temperature degC
Definition at line 331 of file ms5611.cpp.
void cmd_reset | ( | ) |
Initialize the MS5611 and set up the coefficients First - reset the MS5611 Second - load coefficient values from the MS5611 PROM Third - calculate coefficient checksum This routine only needs to be run once at boot up.
send reset sequence
- Parameters:
-
NONE
- Returns:
- none
Definition at line 132 of file ms5611.cpp.
float getAltitudeFT | ( | float | sea_pressure ) |
Calculate and returns altitude in feet Returns float altitude in feet.
get altitude from known sea level barometer, @ no pre-pressure calculation
- Parameters:
-
float known pressure (mB) at sea level
float sea level barometer
- Returns:
- float altitude in feet
Definition at line 366 of file ms5611.cpp.
double getPressure | ( | ) |
Return compensated barometric pressure Returns double pressure in millibars DOES NOT RE-CALCULATE FIRST!!! Saves time if you calcTemp(); first.
get pressure, no calculation
- Parameters:
-
NONE
- Returns:
- double barometric pressure millibar
Definition at line 353 of file ms5611.cpp.
float getSeaLevelBaroFT | ( | float | known_alt ) |
Calculate and returns sea level baro Returns float seal level barometer in feet.
get sea level pressure from known altitude(ft), @ no pre-pressure calculation
- Parameters:
-
float known altitude in feet
float known altitude in feet
- Returns:
- float seal level barometer in mb
Definition at line 379 of file ms5611.cpp.
float getSeaLevelBaroM | ( | float | known_alt ) |
Calculate and returns sea level baro Returns float seal level barometer in meters.
get sea level pressure from known altitude(m), @ no pre-pressure calculation
- Parameters:
-
float known altitude in meters
float known altitude in meters
- Returns:
- float seal level barometer in mb
Definition at line 392 of file ms5611.cpp.
Generated on Thu Jul 14 2022 09:53:18 by 1.7.2