Sample program for MS5611 (I2C, SPI) library
Fork of MS5607Example by
main.cpp@0:c06e6d1972d6, 2012-07-03 (annotated)
- Committer:
- yamaguch
- Date:
- Tue Jul 03 08:58:18 2012 +0000
- Revision:
- 0:c06e6d1972d6
- Child:
- 1:515d101b8e55
0.92
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
yamaguch | 0:c06e6d1972d6 | 1 | #include "mbed.h" |
yamaguch | 0:c06e6d1972d6 | 2 | //#include "MS5607SPI.h" |
yamaguch | 0:c06e6d1972d6 | 3 | #include "MS5607I2C.h" |
yamaguch | 0:c06e6d1972d6 | 4 | |
yamaguch | 0:c06e6d1972d6 | 5 | int main() { |
yamaguch | 0:c06e6d1972d6 | 6 | //MS5607SPI ms5607(p11, p12, p13, p10); |
yamaguch | 0:c06e6d1972d6 | 7 | MS5607I2C ms5607(p9, p10, false); |
yamaguch | 0:c06e6d1972d6 | 8 | |
yamaguch | 0:c06e6d1972d6 | 9 | ms5607.printCoefficients(); |
yamaguch | 0:c06e6d1972d6 | 10 | printf("Pressure = %.0f Pa\n", ms5607.getPressure()); |
yamaguch | 0:c06e6d1972d6 | 11 | printf("Temperature = %.2f degC\n", ms5607.getTemperature()); |
yamaguch | 0:c06e6d1972d6 | 12 | printf("Altitude = %.2f m\n", ms5607.getAltitude()); |
yamaguch | 0:c06e6d1972d6 | 13 | } |