Sample program for MS5607 (I2C, SPI) library

Dependencies:   mbed MS5607

main.cpp

Committer:
yamaguch
Date:
2012-07-03
Revision:
0:c06e6d1972d6

File content as of revision 0:c06e6d1972d6:

#include "mbed.h"
//#include "MS5607SPI.h"
#include "MS5607I2C.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());
}