Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testhaptic - example script #62

Open
marcusva opened this issue May 27, 2014 · 1 comment
Open

Testhaptic - example script #62

marcusva opened this issue May 27, 2014 · 1 comment

Comments

@marcusva
Copy link
Collaborator

Originally reported by: mungewell (Bitbucket: mungewell, GitHub: mungewell)


Following the same concept/format as the SDL testhaptic, please find attached a python script to do the same.

simon@bigbox:~/PySDL2-0.9.2/examples$ python testhaptic.py
Trying to find haptics
Found 0 : G27 Racing Wheel
Found 1 : Sony Computer Entertainment Wireless Controller
Using device 0
   effect 0 Sine Wave
   effect 1 Triangle
   effect 2 Sawtooth Up
   effect 3 Sawtooth Down
   effect 4 Ramp
   effect 5 Constant Force
   effect 6 Left/Right
      Bug 'leftright' not defined
Now playing effects for 5 seconds each with 1 second delay between
   Playing effect 0
   Playing effect 1
   Playing effect 2
   Playing effect 3
   Playing effect 4
   Playing effect 5
   Playing effect 6

Minor bug (in PySDL2) is that 'leftright' argument for HapticEffect is not defined.


@marcusva
Copy link
Collaborator Author

marcusva commented Oct 7, 2015

Original comment by Martin Egginton (Bitbucket: maeggy, GitHub: Unknown):


thanks for this useful script. Trying to get this to work with my G27 hardware

I get the same output as above, but there is no response from the wheel itself. All of the id values are returned as -1.

I checked sdl2.SDL_GetError() but it returns "Haptic error Unable to create effect"
I also checked sdl2.SDL_HapticEffectSupported(haptic,efx[nefx]) which returns 1

Do you have any ideas where I may be going wrong? Using PySDL2 0.9.3 and Python 2.7.6

Many thanks in advance,
Martin

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

No branches or pull requests

1 participant