BMP085 Sparkfun class
Diff: main.cpp
- Revision:
- 0:2ae3dabe45e8
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Oct 02 14:02:29 2013 +0000 @@ -0,0 +1,19 @@ +#include "mbed.h" +#include "BMP085.h" +const int SlaveAddressI2C = 0xEE; //This is the slave address of the device +Serial pc(USBTX, USBRX); +BMP085 Sensor(SlaveAddressI2C, p28, p27, p21); + +int main() { + + Sensor.GetCalibrationData(); + + while(1) + { + + pc.printf("Temp=%d deg C\n\r",Sensor.calculate_tempc()); + pc.printf("Pressure=%dkPa\n\r",Sensor.calculate_pressure()); + + wait(1); + } +}