Fixed algorithm to read 3 bytes of accelerometer data registers
Fork of COG4050_adxl355_adxl357 by
Calibration/CALIBRATION.h@10:e054891b3598, 2018-09-10 (annotated)
- Committer:
- nfathurr
- Date:
- Mon Sep 10 10:01:49 2018 +0000
- Revision:
- 10:e054891b3598
- Parent:
- 9:6c803986dbde
Fixed algorithm to read 3 bytes of accelerometer data registers
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
vtoffoli | 8:9e6ead2ee8d7 | 1 | |
vtoffoli | 8:9e6ead2ee8d7 | 2 | #ifndef CALIBRATION_H_ |
vtoffoli | 8:9e6ead2ee8d7 | 3 | #define CALIBRATION_H_ |
vtoffoli | 8:9e6ead2ee8d7 | 4 | |
vtoffoli | 8:9e6ead2ee8d7 | 5 | class CALIBRATION |
vtoffoli | 8:9e6ead2ee8d7 | 6 | { |
vtoffoli | 8:9e6ead2ee8d7 | 7 | public: |
vtoffoli | 8:9e6ead2ee8d7 | 8 | // -------------------------- // |
vtoffoli | 8:9e6ead2ee8d7 | 9 | // CONST AND VARIABLES // |
vtoffoli | 8:9e6ead2ee8d7 | 10 | // -------------------------- // |
vtoffoli | 8:9e6ead2ee8d7 | 11 | typedef struct { |
vtoffoli | 9:6c803986dbde | 12 | // sensitivity - we do not consider cross sensitivity |
vtoffoli | 9:6c803986dbde | 13 | float S[3]; |
vtoffoli | 9:6c803986dbde | 14 | // temperature sensitivity |
vtoffoli | 9:6c803986dbde | 15 | float St[3]; |
vtoffoli | 8:9e6ead2ee8d7 | 16 | // 0g offset |
vtoffoli | 9:6c803986dbde | 17 | float B[3]; |
vtoffoli | 8:9e6ead2ee8d7 | 18 | } calib_data_t; |
vtoffoli | 9:6c803986dbde | 19 | calib_data_t adxl355_sensitivity; |
vtoffoli | 9:6c803986dbde | 20 | calib_data_t adxl357_sensitivity; |
vtoffoli | 8:9e6ead2ee8d7 | 21 | // -------------------------- // |
vtoffoli | 8:9e6ead2ee8d7 | 22 | // FUNCTIONS // |
vtoffoli | 8:9e6ead2ee8d7 | 23 | // -------------------------- // |
vtoffoli | 8:9e6ead2ee8d7 | 24 | |
vtoffoli | 9:6c803986dbde | 25 | calib_data_t convert_2p_all(float angle[1], float meas[1][2]); |
vtoffoli | 9:6c803986dbde | 26 | // angle = | angle1 angle2| in RAD |
vtoffoli | 9:6c803986dbde | 27 | // meas = | ax1 ay1 az1 | |
vtoffoli | 9:6c803986dbde | 28 | // | ax2 ay2 az2 | |
vtoffoli | 9:6c803986dbde | 29 | void convert_2p(float meas[1], int axis); |
vtoffoli | 9:6c803986dbde | 30 | // angle = | angle1 angle2| in RAD |
vtoffoli | 9:6c803986dbde | 31 | // meas = | x1 x2 | |
vtoffoli | 9:6c803986dbde | 32 | void convert_4p(float meas[3], int axis); |
vtoffoli | 9:6c803986dbde | 33 | // for each axis |
vtoffoli | 9:6c803986dbde | 34 | // angle = | anglex1 anglex2 angley3 angley4| |
vtoffoli | 9:6c803986dbde | 35 | // meas = | x1 x2 x3 x4 | |
vtoffoli | 8:9e6ead2ee8d7 | 36 | |
vtoffoli | 9:6c803986dbde | 37 | float matrix_determinant(float a[12][12], float k); |
vtoffoli | 8:9e6ead2ee8d7 | 38 | void matrix_reset(); |
vtoffoli | 8:9e6ead2ee8d7 | 39 | private: |
vtoffoli | 8:9e6ead2ee8d7 | 40 | }; |
vtoffoli | 8:9e6ead2ee8d7 | 41 | |
vtoffoli | 8:9e6ead2ee8d7 | 42 | #endif |