Priyanka Pashte
/
ESD_Project_USBMouse
USBMouse
Accelerometer/Accelerometer.h@0:e062501cfe81, 2015-12-13 (annotated)
- Committer:
- priyankapashte
- Date:
- Sun Dec 13 10:06:24 2015 +0000
- Revision:
- 0:e062501cfe81
USBDevice library modified
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
priyankapashte | 0:e062501cfe81 | 1 | #include "mbed.h" |
priyankapashte | 0:e062501cfe81 | 2 | |
priyankapashte | 0:e062501cfe81 | 3 | class Accelerometer |
priyankapashte | 0:e062501cfe81 | 4 | { |
priyankapashte | 0:e062501cfe81 | 5 | public: |
priyankapashte | 0:e062501cfe81 | 6 | Accelerometer(PinName sda, PinName scl, int address); // Accelerometer pin definition |
priyankapashte | 0:e062501cfe81 | 7 | ~Accelerometer(); // Accelerometer Destructor |
priyankapashte | 0:e062501cfe81 | 8 | |
priyankapashte | 0:e062501cfe81 | 9 | float Acc_X(); // Get X axis Acceleration |
priyankapashte | 0:e062501cfe81 | 10 | |
priyankapashte | 0:e062501cfe81 | 11 | float Acc_Y(); // Get Y axis Acceleration |
priyankapashte | 0:e062501cfe81 | 12 | |
priyankapashte | 0:e062501cfe81 | 13 | float Acc_Z(); // Get Z axis Acceleration |
priyankapashte | 0:e062501cfe81 | 14 | |
priyankapashte | 0:e062501cfe81 | 15 | |
priyankapashte | 0:e062501cfe81 | 16 | private: |
priyankapashte | 0:e062501cfe81 | 17 | I2C i2c; |
priyankapashte | 0:e062501cfe81 | 18 | int addr; |
priyankapashte | 0:e062501cfe81 | 19 | void readRegs(int addr, uint8_t * data, int len); |
priyankapashte | 0:e062501cfe81 | 20 | void writeRegs(uint8_t * data, int len); |
priyankapashte | 0:e062501cfe81 | 21 | int16_t getAccAxis(uint8_t addr); |
priyankapashte | 0:e062501cfe81 | 22 | }; |
priyankapashte | 0:e062501cfe81 | 23 | |
priyankapashte | 0:e062501cfe81 | 24 | |
priyankapashte | 0:e062501cfe81 | 25 | |
priyankapashte | 0:e062501cfe81 | 26 | |
priyankapashte | 0:e062501cfe81 | 27 | |
priyankapashte | 0:e062501cfe81 | 28 | |
priyankapashte | 0:e062501cfe81 | 29 |