barometric pressure sensor BMP085 http://mbed.org/users/okini3939/notebook/barometric-pressure-sensor-bmp085/ http://mbed.org/users/okini3939/notebook/weatherduino-on-mbed/
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 }
Generated on Tue Jul 12 2022 18:55:59 by 1.7.2