
Bosh pressure sensor
Fork of BMP085 by
Diff: main.cpp
- Revision:
- 2:dee533027e61
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Jun 12 13:10:12 2013 +0000 @@ -0,0 +1,31 @@ +#include "mbed.h" +#include "BMP085.h" + +#include <math.h> + +#define SDA p9 +#define SCL p10 +#define PI 3.14159265 + +Serial pc(USBTX, USBRX); +//Serial pc(p28, p27); +int main() +{ + float pres, temp; + pc.printf("Inicializing...\r\n"); + BMP085 *bmp085 = new BMP085(SDA, SCL, BMP085_oss4); + printf("OK...\r\n"); + wait(1); + + while(1) + { + + bmp085->update(); + pres = bmp085->get_pressure(); + temp = bmp085->get_temperature(); + + + pc.printf("pressure: %f \t\ttemperature: %f \t\r\n", pres, temp); + wait_ms(200); + } +}