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.
Sensors/Alt/BMP085.h@16:74a6531350b5, 2012-10-31 (annotated)
- Committer:
- maetugr
- Date:
- Wed Oct 31 14:44:07 2012 +0000
- Revision:
- 16:74a6531350b5
- Parent:
- Sensors/BMP085/BMP085.h@14:cf260677ecde
- Child:
- 17:e096e85f6c36
nach Kompassumstellung auf I2C_Sensor (nicht getestet)
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
maetugr | 14:cf260677ecde | 1 | #ifndef BMP085_H |
maetugr | 14:cf260677ecde | 2 | #define BMP085_H |
maetugr | 14:cf260677ecde | 3 | |
maetugr | 16:74a6531350b5 | 4 | #include "mbed.h" |
maetugr | 14:cf260677ecde | 5 | #include "I2C_Sensor.h" |
maetugr | 14:cf260677ecde | 6 | |
maetugr | 14:cf260677ecde | 7 | // I2C address |
maetugr | 14:cf260677ecde | 8 | #define BMP085_I2C_ADDRESS 0xEE |
maetugr | 14:cf260677ecde | 9 | |
maetugr | 14:cf260677ecde | 10 | class BMP085 : public I2C_Sensor |
maetugr | 14:cf260677ecde | 11 | { |
maetugr | 14:cf260677ecde | 12 | public: |
maetugr | 14:cf260677ecde | 13 | BMP085(PinName sda, PinName scl); |
maetugr | 14:cf260677ecde | 14 | |
maetugr | 14:cf260677ecde | 15 | float data[3]; |
maetugr | 14:cf260677ecde | 16 | |
maetugr | 14:cf260677ecde | 17 | void read(); |
maetugr | 14:cf260677ecde | 18 | |
maetugr | 14:cf260677ecde | 19 | void calibrate(int s); |
maetugr | 14:cf260677ecde | 20 | |
maetugr | 14:cf260677ecde | 21 | float get_angle(); |
maetugr | 14:cf260677ecde | 22 | |
maetugr | 14:cf260677ecde | 23 | private: |
maetugr | 14:cf260677ecde | 24 | // raw data and function to measure it |
maetugr | 14:cf260677ecde | 25 | int raw[3]; |
maetugr | 14:cf260677ecde | 26 | void readraw(); |
maetugr | 14:cf260677ecde | 27 | |
maetugr | 14:cf260677ecde | 28 | // calibration parameters and their saving |
maetugr | 14:cf260677ecde | 29 | int Min[3]; |
maetugr | 14:cf260677ecde | 30 | int Max[3]; |
maetugr | 14:cf260677ecde | 31 | float scale[3]; |
maetugr | 14:cf260677ecde | 32 | float offset[3]; |
maetugr | 14:cf260677ecde | 33 | }; |
maetugr | 14:cf260677ecde | 34 | |
maetugr | 14:cf260677ecde | 35 | #endif |