WebbotLib AVR library
WebbotLib It just does it
  C++ documentation  C documentation

calibrate

Manually calibrate the X, Y and Z axes all in one go.
Syntax
Accelerometer. calibrate(minX,maxX,minY,maxY,minZ,maxZ)
Where Accelerometer is the name you have given to the device in Project Designer.
Parameters
TypeNameDescription
'minX'
The smallest value you received for the x axis during your calibration test.
'maxX'
The largest value you received for the x axis during your calibration test.
'minY'
The smallest value you received for the y axis during your calibration test.
'maxY'
The largest value you received for the y axis during your calibration test.
'minZ'
The smallest value you received for the z axis during your calibration test.
'maxZ'
The largest value you received for the z axis during your calibration test.
Returns
None
Example
To calibrate your sensor:-
1. Use the example code generated by Project Designer to repeatedly dump out the x,y,z values
2. Carefully rotate the sensor around the x, y and then z axes whilst taking care not to bounce it up and down
3. Note down the minimum and maximum values that you see for each axis
4. In appInitSoftware: calibrate each axis by passing in the minimum and maximum values that you noted down. For example if your device is called 'myAccel' and the X values ranged between -935 and 1361, Y between -900 and 1300 and Z between -950 and 1200 then:-
myAccel.calibrate(-935,1361, -900,1300, -950,1200);
Now re-run your tests and you should find that it will return values between -1000 and +1000.
Alternatively you can calibrate each axis individually.

 

 

Valid XHTML 1.0 Transitional