BMP085
Dependencies: BMP085_2 TextLCD mbed
Fork of HelloBMP085 by
Revision 3:773bc12a9271, committed 2016-02-29
- Comitter:
- Tuxitheone
- Date:
- Mon Feb 29 19:00:08 2016 +0000
- Parent:
- 2:62e0e24e0091
- Commit message:
- BMP085
Changed in this revision
TextLCD.lib | Show annotated file Show diff for this revision Revisions of this file |
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 62e0e24e0091 -r 773bc12a9271 TextLCD.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TextLCD.lib Mon Feb 29 19:00:08 2016 +0000 @@ -0,0 +1,1 @@ +https://mbed.org/users/wim/code/TextLCD/#e0da005a777f
diff -r 62e0e24e0091 -r 773bc12a9271 main.cpp --- a/main.cpp Mon Jul 29 08:02:06 2013 +0000 +++ b/main.cpp Mon Feb 29 19:00:08 2016 +0000 @@ -1,21 +1,30 @@ #include "mbed.h" #include "BMP085.h" +#include "TextLCD.h" -DigitalOut myled(LED1); -BMP085 bmp085(p28, p27); +DigitalOut myled1(LED1); +DigitalOut myled4(LED4); +BMP085 bmp085(p9, p10); Serial pc(USBTX, USBRX); - -int main() { - pc.printf("main\n"); +TextLCD LCD(p15, p16, p17, p18, p19, p20,TextLCD::LCD20x4); // rs, e, d4-d7 + +int main() +{ + pc.printf("main\n\r"); float p, t; - + while(1) { - myled = 1; + LCD.cls(); + myled1 = 1; + myled4 = 0; bmp085.update(); p = bmp085.get_pressure(); t = bmp085.get_temperature(); - pc.printf("P %6.2f t %6.2f\n", p, t); - myled = 0; - wait(3); - }//while -}//main + // pc.printf("Pressure %6.2f - Temperature %6.2f\n\r", p, t); + LCD.printf("Pressure %6.2f\n", p/1000-1); + LCD.printf("In Temp %6.2f\n", t); + myled1 = 0; + myled4 = 1; + wait(1.0); + } +}