I am trying to calibrate a ADXL345 accelerator using the sparkfun and adafruit guides as per:
I used both as 1 was better in one area, and the other in another area, but regardless I am not sure how I go from the result to the calculated offsets and gain to modify the raw data.
As per the sparkfun guide linked above:
The offset values and gain factors are calculated with the following equations as stated in the Application Note from Analog Devices (page 8: equations 17 and 18).
In the DEFINED VARIABLES section of the code is where we will place the new calculated values for offset and gain.
/************** DEFINED VARIABLES **************/ /* */ #define offsetX 0 // OFFSET values #define offsetY 0 #define offsetZ 0
define gainX 1 // GAIN factors
define gainY 1
define gainZ 1
I am sorry if I am just being slow or if I am not clear on this, but I performed the calibration steps and the results for the 6 tests were:
Accel Minimums: -4 0 0 Accel Maximums: 0 3 276 Accel Minimums: -4 0 0 Accel Maximums: 12 258 276 Accel Minimums: -250 0 -6 Accel Maximums: 12 258 276 Accel Minimums: -250 -259 -6 Accel Maximums: 12 258 276 Accel Minimums: -250 -259 -6 Accel Maximums: 264 258 276 Accel Minimums: -250 -259 -230 Accel Maximums: 264 258 276
What I am missing is how do I go from those calibration results to the offset and gain values as per their formula?