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@17:e096e85f6c36, 2012-10-31 (annotated)
- Committer:
- maetugr
- Date:
- Wed Oct 31 16:53:01 2012 +0000
- Revision:
- 17:e096e85f6c36
- Parent:
- 16:74a6531350b5
- Child:
- 18:c8c09a3913ba
alle Sensoren mit i2c auf I2C_Sensor umgestellt (nicht getestet), noch keine calibration save per I2C_Sensor
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 | #define BMP085_I2C_ADDRESS 0xEE |
maetugr | 14:cf260677ecde | 8 | |
maetugr | 14:cf260677ecde | 9 | class BMP085 : public I2C_Sensor |
maetugr | 14:cf260677ecde | 10 | { |
maetugr | 14:cf260677ecde | 11 | public: |
maetugr | 14:cf260677ecde | 12 | BMP085(PinName sda, PinName scl); |
maetugr | 14:cf260677ecde | 13 | |
maetugr | 14:cf260677ecde | 14 | float data[3]; |
maetugr | 14:cf260677ecde | 15 | |
maetugr | 14:cf260677ecde | 16 | void read(); |
maetugr | 14:cf260677ecde | 17 | |
maetugr | 14:cf260677ecde | 18 | void calibrate(int s); |
maetugr | 14:cf260677ecde | 19 | |
maetugr | 14:cf260677ecde | 20 | float get_angle(); |
maetugr | 14:cf260677ecde | 21 | |
maetugr | 14:cf260677ecde | 22 | private: |
maetugr | 14:cf260677ecde | 23 | // raw data and function to measure it |
maetugr | 14:cf260677ecde | 24 | int raw[3]; |
maetugr | 14:cf260677ecde | 25 | void readraw(); |
maetugr | 14:cf260677ecde | 26 | |
maetugr | 14:cf260677ecde | 27 | // calibration parameters and their saving |
maetugr | 14:cf260677ecde | 28 | int Min[3]; |
maetugr | 14:cf260677ecde | 29 | int Max[3]; |
maetugr | 14:cf260677ecde | 30 | float scale[3]; |
maetugr | 14:cf260677ecde | 31 | float offset[3]; |
maetugr | 14:cf260677ecde | 32 | }; |
maetugr | 14:cf260677ecde | 33 | |
maetugr | 14:cf260677ecde | 34 | #endif |