![](/media/cache/profiles/8ad6635f33710af6a535e8fb8486975e.50x50_q85.jpg)
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/I2C_Sensor.h
- Committer:
- maetugr
- Date:
- 2012-10-27
- Revision:
- 14:cf260677ecde
- Child:
- 15:753c5d6a63b3
File content as of revision 14:cf260677ecde:
#ifndef I2C_Sensor_H #define I2C_Sensor_H class I2C_Sensor { public: I2C_Sensor(PinName sda, PinName scl, int8_t address); float data[3]; void read(); void calibrate(); protected: // I2C functions void writeRegister(char address, char data); void readMultiRegister(char address, char* output, int size); private: I2C i2c; // I2C-Bus int8_t i2c_address; // address // raw data and function to measure it int raw[3]; void readraw(); LocalFileSystem local; // file access to save calibration values }; #endif