Sample program for MS5607 (I2C, SPI) library

Dependencies:   mbed MS5607

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 //#include "MS5607SPI.h"
00003 #include "MS5607I2C.h"
00004 
00005 int main() {
00006     //MS5607SPI ms5607(p11, p12, p13, p10);
00007     MS5607I2C ms5607(p9, p10, false);
00008     
00009     ms5607.printCoefficients();
00010     printf("Pressure = %.0f Pa\n", ms5607.getPressure());
00011     printf("Temperature = %.2f degC\n", ms5607.getTemperature());
00012     printf("Altitude = %.2f m\n", ms5607.getAltitude());
00013 }