UAVRO / ms5611

Dependents:   Q2_Stabi

Fork of ms5611 by Kevin Braun

Files at this revision

API Documentation at this revision

Comitter:
loopsva
Date:
Mon Jun 24 19:11:28 2013 +0000
Parent:
5:0d7b229474c6
Child:
7:90ee2168baa7
Commit message:
Updated .h documentation and added i2c frequency set in .cpp file.

Changed in this revision

ms5611.cpp Show annotated file Show diff for this revision Revisions of this file
ms5611.h Show annotated file Show diff for this revision Revisions of this file
--- a/ms5611.cpp	Fri May 17 16:16:16 2013 +0000
+++ b/ms5611.cpp	Mon Jun 24 19:11:28 2013 +0000
@@ -27,6 +27,7 @@
 // Constructor and destructor
 
 ms5611::ms5611(PinName sda, PinName scl)  : _i2c(sda, scl) {
+        _i2c.frequency(400000);
 }
 
 //********************************************************
--- a/ms5611.h	Fri May 17 16:16:16 2013 +0000
+++ b/ms5611.h	Mon Jun 24 19:11:28 2013 +0000
@@ -47,7 +47,6 @@
  *
  * int main (void) {
  *     pc.baud(921600);                        // set up USB serial speed
- *     i2c.frequency(400000);                  // set up i2c speed
  *
  *     // set up the ms5611
  *     pc.printf("\n\nInitializing the MS5611..\n");
@@ -55,10 +54,17 @@
  *     pc.printf("Ready\n");
  *
  *     while(1) {
- *         double Temp = ms.calcTemp();
- *         double Press = ms.calcPressure();
- *         double Altitude = ms.getAltitude(1013.25);  //enter pressure at sea level
- *         pc.printf("Temp: %.2f degC    Barometer: %.1f mB  %.3f in/Hg   Alt: %.1f\n", Temp, Press, Press * 0.0295301, Altitude);
+ *         double Temp = ms.calcTemp();                         //calculate press and temp, then returns current temperature in degC
+ *         double Press = ms.calcPressure();                    //calculate press and temp, then returns current pressure in mb
+ *         double GetPress = ms.getPressure();                  //returns current pressure in mb. Does no calculations.  Ususally done after calcTemp()
+ *         double Altitude = ms.getAltitudeFT(1013.25);         //enter pressure at sea level in mb, returns altitude in feet
+ *         double PressSeaLvlFT = ms.getSeaLevelBaroFT(327.2);  //enter known altitude in feet, returns sea level pressure in mb
+ *         double PressSeaLvlM = ms.getAltitudeFT(99.73);       //enter known altitude in meters, returns seal level pressure in mb
+ *
+ *         pc.printf("Temp: %.2f degC\n", Temp);    
+ *         pc.printf("Barometer: %.1f mB  %.3f in/Hg\n", Press, Press * 0.0295301);
+ *         pc.printf("Alt: %.1f ft\n", Altitude);
+ *         pc.printf("Sea_Lvl: %.1f ft   %.2f m\n", PressSeaLvlFT, PressSeaLvlM);
  *         wait(2.0);
  *     }
  * }