NOT FINISHED YET!!! My first try to get a self built fully working Quadrocopter based on an mbed, a self built frame and some other more or less cheap parts.
Diff: Sensors/Alt/BMP085.h
- Revision:
- 16:74a6531350b5
- Parent:
- 14:cf260677ecde
- Child:
- 17:e096e85f6c36
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Sensors/Alt/BMP085.h Wed Oct 31 14:44:07 2012 +0000 @@ -0,0 +1,35 @@ +#ifndef BMP085_H +#define BMP085_H + +#include "mbed.h" +#include "I2C_Sensor.h" + +// I2C address +#define BMP085_I2C_ADDRESS 0xEE + +class BMP085 : public I2C_Sensor +{ + public: + BMP085(PinName sda, PinName scl); + + float data[3]; + + void read(); + + void calibrate(int s); + + float get_angle(); + + private: + // raw data and function to measure it + int raw[3]; + void readraw(); + + // calibration parameters and their saving + int Min[3]; + int Max[3]; + float scale[3]; + float offset[3]; +}; + +#endif