BMP085 Sparkfun class

Committer:
mr63
Date:
Wed Oct 02 14:02:29 2013 +0000
Revision:
0:2ae3dabe45e8
This is a class for the BMP085 Pressure Temperature sensor from Sparkfun.  I believe that the sensor I have does not work, so if this doesn't work let me know.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mr63 0:2ae3dabe45e8 1 #include "mbed.h"
mr63 0:2ae3dabe45e8 2 #include "BMP085.h"
mr63 0:2ae3dabe45e8 3 const int SlaveAddressI2C = 0xEE; //This is the slave address of the device
mr63 0:2ae3dabe45e8 4 Serial pc(USBTX, USBRX);
mr63 0:2ae3dabe45e8 5 BMP085 Sensor(SlaveAddressI2C, p28, p27, p21);
mr63 0:2ae3dabe45e8 6
mr63 0:2ae3dabe45e8 7 int main() {
mr63 0:2ae3dabe45e8 8
mr63 0:2ae3dabe45e8 9 Sensor.GetCalibrationData();
mr63 0:2ae3dabe45e8 10
mr63 0:2ae3dabe45e8 11 while(1)
mr63 0:2ae3dabe45e8 12 {
mr63 0:2ae3dabe45e8 13
mr63 0:2ae3dabe45e8 14 pc.printf("Temp=%d deg C\n\r",Sensor.calculate_tempc());
mr63 0:2ae3dabe45e8 15 pc.printf("Pressure=%dkPa\n\r",Sensor.calculate_pressure());
mr63 0:2ae3dabe45e8 16
mr63 0:2ae3dabe45e8 17 wait(1);
mr63 0:2ae3dabe45e8 18 }
mr63 0:2ae3dabe45e8 19 }