Library for accelerometer KXR94-2050
KXR94_2050.h@0:2700ada3a245, 2015-01-03 (annotated)
- Committer:
- 66keg
- Date:
- Sat Jan 03 15:06:55 2015 +0000
- Revision:
- 0:2700ada3a245
- Child:
- 1:b3acee234ab5
created
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
66keg | 0:2700ada3a245 | 1 | #ifndef KXR94_2050_H |
66keg | 0:2700ada3a245 | 2 | #define KXR94_2050_H |
66keg | 0:2700ada3a245 | 3 | |
66keg | 0:2700ada3a245 | 4 | #include "mbed.h" |
66keg | 0:2700ada3a245 | 5 | |
66keg | 0:2700ada3a245 | 6 | class KXR94_2050 { |
66keg | 0:2700ada3a245 | 7 | public: |
66keg | 0:2700ada3a245 | 8 | KXR94_2050(PinName OutX, PinName OutY, PinName OutZ); |
66keg | 0:2700ada3a245 | 9 | ~KXR94_2050(); |
66keg | 0:2700ada3a245 | 10 | void setZeroVal(uint16_t x_zero, uint16_t y_zero, uint16_t z_zero); |
66keg | 0:2700ada3a245 | 11 | void getRawData(float &pitch, float &roll); // degree data |
66keg | 0:2700ada3a245 | 12 | |
66keg | 0:2700ada3a245 | 13 | private: |
66keg | 0:2700ada3a245 | 14 | AnalogIn _OutX, _OutY, _OutZ; |
66keg | 0:2700ada3a245 | 15 | int _mean_average_num; |
66keg | 0:2700ada3a245 | 16 | |
66keg | 0:2700ada3a245 | 17 | uint16_t X_ZERO_VAL; |
66keg | 0:2700ada3a245 | 18 | uint16_t Y_ZERO_VAL; |
66keg | 0:2700ada3a245 | 19 | uint16_t Z_ZERO_VAL; |
66keg | 0:2700ada3a245 | 20 | }; |
66keg | 0:2700ada3a245 | 21 | |
66keg | 0:2700ada3a245 | 22 | #endif |