It's a good idea to use a gamepad that is known to work well with the BeagleBone or BeagleBone Black. Most of the low-end gamepads and joysticks work very well (because they use commonly used chipsets), and also some of the higher-end devices, like the Logitech F710 works very well and is very accurate.
Install the node-joystick module with this command line:
Add this code to your project:
// Set a deadzone of +/-3500 (out of +/-32k) and a sensitivty // of 350 to reduce signal noise in joystick axis var joystick = new (require('joystick'))(0, 3500, 350); joystick.on('button', onJoystickData);
In the callback you will get data on this format:
Using the BeagleBone >