CORE
/
Sample_MS5607
Sample for MS5607 (used by LPC1768)
Diff: main.cpp
- Revision:
- 0:6e902e6168af
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Oct 24 17:07:57 2016 +0000 @@ -0,0 +1,19 @@ +#include "mbed.h" +//#include "MS5607SPI.h" +#include "MS5607I2C.h" + +//MS5607SPI ms5607(p11, p12, p13, p3); +MS5607I2C ms5607(p28, p27, false); +Serial pc(USBTX, USBRX); + +int main() { + float Alt; + while(1){ + Alt = ms5607.getAltitude(); + //ms5607.printCoefficients(); + pc.printf("Pressure = %.0f Pa\t", ms5607.getPressure()); + pc.printf("Temperature = %.2f degC\n", ms5607.getTemperature()); + pc.printf("Altitude = %.2f m\n",Alt); + wait(1); + } +}