Skip to content

Instantly share code, notes, and snippets.

@jeffgriffin
Created March 15, 2013 05:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeffgriffin/5167698 to your computer and use it in GitHub Desktop.
Save jeffgriffin/5167698 to your computer and use it in GitHub Desktop.
for (i = 0; i < 2; i++) {
input_set_abs_params(input_dev, ABS_X+i, 32, 223, 0, 10); //In theory, all axes operate from 0 to 255. In practice, the plastic enclosure and other mechanical realities limit extremes and there is a great variance in achievable extremes and centers. Values below are based on worst-case scenarios for extremes among a set of controllers. -Jeff Griffin
input_set_abs_params(input_dev, ABS_RX+i, 50, 205, 0, 10);
input_set_abs_params(input_dev, ABS_GAS+i, -149, 222, 0, 10); // False bottom prevents negative gas/brake. In practice, min/center~35, max~222
input_set_abs_params(input_dev, ABS_HAT0X+i, -1, 1, 0, 0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment