Seeed
/
Seeed_Barometer_Sensor_Example
Example using barometer
Diff: main.cpp
- Revision:
- 0:8381ff08ace1
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sat Aug 16 01:03:36 2014 +0000 @@ -0,0 +1,18 @@ + +#include "mbed.h" +#include "BMP085.h" + +BMP085 barometer(D14, D15); + +int main(void) +{ + float p = 0.0f, t = 0.0f; + + while(1) { + barometer.update(); + p = barometer.get_pressure(); + t = barometer.get_temperature(); + printf("Pressure: %6.2f Temperature(c): %6.2f Temperature(F): %6.2f\n", p, t, 32 + t * 1.8f); + wait(1.0f); + } +}