Library for accelerometer KXR94-2050
Diff: KXR94_2050.h
- Revision:
- 0:2700ada3a245
- Child:
- 1:b3acee234ab5
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/KXR94_2050.h Sat Jan 03 15:06:55 2015 +0000 @@ -0,0 +1,22 @@ +#ifndef KXR94_2050_H +#define KXR94_2050_H + +#include "mbed.h" + +class KXR94_2050 { +public: + KXR94_2050(PinName OutX, PinName OutY, PinName OutZ); + ~KXR94_2050(); + void setZeroVal(uint16_t x_zero, uint16_t y_zero, uint16_t z_zero); + void getRawData(float &pitch, float &roll); // degree data + +private: + AnalogIn _OutX, _OutY, _OutZ; + int _mean_average_num; + + uint16_t X_ZERO_VAL; + uint16_t Y_ZERO_VAL; + uint16_t Z_ZERO_VAL; +}; + +#endif \ No newline at end of file