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

calibrate

Calibrate the joysticks on the controller.
This command should only be called once - when your program starts up - appInitSoftware is a good place. It will activate the joysticks and then read their current positions and remember these as being the 'centre' locations.
Without this call you may notice some non-zero readings from the joystick if it is set to the centre position.
You can also specify a 'deadzone' - ie the radius around the centre point that will be considered as being the centre. Try a value of around 27.
This will return TRUE if the calibration was successful or FALSE if communication with the controller could not be done.
Syntax
SonyPS2. calibrate(deadzone)
Where SonyPS2 is the name you have given to the device in Project Designer.
Parameters
TypeNameDescription
'deadzone'
The radius around the centre point that will be considered as being the centre.
Returns
boolean

 

 

Valid XHTML 1.0 Transitional