Skovbrynet / Mbed 2 deprecated BMP085

Dependencies:   BMP085_2 TextLCD mbed

Fork of HelloBMP085 by Takashi SASAKI

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 #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 }