barometric pressure sensor BMP085 http://mbed.org/users/okini3939/notebook/barometric-pressure-sensor-bmp085/ http://mbed.org/users/okini3939/notebook/weatherduino-on-mbed/

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "BMP085.h"
00003 
00004 BMP085 bmp085(p9, p10);
00005 
00006 DigitalOut myled(LED1);
00007 Serial pc(USBTX, USBRX);
00008 
00009 int main() {
00010     while(1) {
00011         myled = 1;
00012 
00013         bmp085.update();
00014         pc.printf("p:%6.2f hPa / t:%6.2f C\n", bmp085.get_pressure(), bmp085.get_temperature());
00015 
00016         myled = 0;
00017         wait(3);
00018     }
00019 }