Skip to content

Instantly share code, notes, and snippets.

@damascenodiego
Last active April 16, 2022 03:20
Show Gist options
  • Save damascenodiego/7fcac91e44033a655f8c89ba2aebfd9a to your computer and use it in GitHub Desktop.
Save damascenodiego/7fcac91e44033a655f8c89ba2aebfd9a to your computer and use it in GitHub Desktop.
Code to test the force feedback feature in steering wheel controllers (tested wth the Logitech G29)
import evdev
from evdev import ecodes, InputDevice
device = evdev.list_devices()[0]
evtdev = InputDevice(device)
val = 65535 # val \in [0,65535]
evtdev.write(ecodes.EV_FF, ecodes.FF_AUTOCENTER, val)
@soulslicer
Copy link

Do you have a similar script to control rumble, or to control feedback to the foot pedal?

@damascenodiego
Copy link
Author

damascenodiego commented Oct 28, 2019

Sorry, @soulslicer ... I haven't tried to use these features.
However, if you take a look at the evdev documentation, there are methods you can call to explore all features supported by your joystick/steering wheel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment