Sample program for MS5611 (I2C, SPI) library
Fork of MS5607Example by
Diff: main.cpp
- Revision:
- 1:515d101b8e55
- Parent:
- 0:c06e6d1972d6
--- a/main.cpp Tue Jul 03 08:58:18 2012 +0000 +++ b/main.cpp Tue Jun 24 05:46:09 2014 +0000 @@ -1,13 +1,27 @@ +/* MS5611 Pressure sensor example +Aerodyne Labs +2014 + +This example uses the MS511 Library to read the temperature and pressure readings +from the MS5611 sensor. It has been modified from the MS507 sensor library with +the different calculations that the MS5611 requires. Otherwise, this library is +identical to the MS5607 +*/ #include "mbed.h" -//#include "MS5607SPI.h" -#include "MS5607I2C.h" + +//Only uncomment the one needed. +//#include "MS5611SPI.h" +#include "MS5611I2C.h" int main() { - //MS5607SPI ms5607(p11, p12, p13, p10); - MS5607I2C ms5607(p9, p10, false); - - ms5607.printCoefficients(); - printf("Pressure = %.0f Pa\n", ms5607.getPressure()); - printf("Temperature = %.2f degC\n", ms5607.getTemperature()); - printf("Altitude = %.2f m\n", ms5607.getAltitude()); + //Only uncomment the I2C or SPI version. + //MS5611SPI ms5611(p11, p12, p13, p10); + //MS5611I2C ms5611(p9, p10, false); + //PB_9 and PB_8 for Nucleo boards + MS5611I2C ms5611(PB_9, PB_8, false); + //Print the Coefficients from the + ms5611.printCoefficients(); + printf("Pressure = %.0f Pa \r\n", ms5611.getPressure()); + printf("Temperature = %.2f degC \r\n", ms5611.getTemperature()); + printf("Altitude = %.2f m \r\n", ms5611.getAltitude()); } \ No newline at end of file