You can probably add a deadzone in the computer settings and or the game itself, but otherwise have a look at

// Record "resting values" min and max
#define L_x_min_rest 488
#define L_x_max_rest...