Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: BMP085_2 TextLCD mbed
Fork of HelloBMP085 by
main.cpp
00001 #include "mbed.h" 00002 #include "BMP085.h" 00003 #include "TextLCD.h" 00004 00005 DigitalOut myled1(LED1); 00006 DigitalOut myled4(LED4); 00007 BMP085 bmp085(p9, p10); 00008 Serial pc(USBTX, USBRX); 00009 TextLCD LCD(p15, p16, p17, p18, p19, p20,TextLCD::LCD20x4); // rs, e, d4-d7 00010 00011 int main() 00012 { 00013 pc.printf("main\n\r"); 00014 float p, t; 00015 00016 while(1) { 00017 LCD.cls(); 00018 myled1 = 1; 00019 myled4 = 0; 00020 bmp085.update(); 00021 p = bmp085.get_pressure(); 00022 t = bmp085.get_temperature(); 00023 // pc.printf("Pressure %6.2f - Temperature %6.2f\n\r", p, t); 00024 LCD.printf("Pressure %6.2f\n", p/1000-1); 00025 LCD.printf("In Temp %6.2f\n", t); 00026 myled1 = 0; 00027 myled4 = 1; 00028 wait(1.0); 00029 } 00030 }
Generated on Tue Jul 12 2022 21:12:18 by
1.7.2
