Regarding deadband, we use the following set of macros:
Code:
#ifndef DEADBAND_INPUT_THRESHOLD
#define DEADBAND_INPUT_THRESHOLD 0.10
#endif
#define DEADBAND(n,t) ((ABS(n) > (t))? (n): 0)
#define DEADBAND_INPUT(n) DEADBAND(n, DEADBAND_INPUT_THRESHOLD)
float x = DEADBAND_INPUT(joystick.GetX());
float y = DEADBAND_INPUT(-joystick.GetY());