kr15h / ofxPiMapper

Projection mapping addon for openFrameworks that works on the Raspberry Pi
http://ofxpimapper.com
Other
460 stars 92 forks source link

example gamepad #123

Open magdesign opened 6 years ago

magdesign commented 6 years ago

What for is the example gamepad? Does this work with a PS3 usb controller instead of the mouse?

kr15h commented 6 years ago

Yes, that's the idea. It uses STL game engine.

magdesign commented 6 years ago

This means its still necessary to start ofxPiMapper with an usb device connected? I am trying to figure out if a GPIO gamepad like this http://www.keyestudio.com/shop/keyestudio-rpi-joystick-shield.html would work as a mapping controller. Since ssh control is not implemented and my keyboard simulation is far too slow....

magdesign commented 6 years ago

I successfully compiled the example_gamepad after installing SDL: sudo apt-get install libsdl2-dev sudo apt-get install libsdl2-2.0-0

Then I plugged in an usb PS2 controller and started ofxPiMapper, all I got was outputs like: SDL_JOYBUTTONDOWN controllerIndex: 0 command: COMMAND_NONE

So would I have to map the controller commands to some actions or how would this work? You mentioned something about STL game engine.

kr15h commented 6 years ago

Yes, you have to map it. I started to develop an addon for this: https://github.com/kr15h/ofxJoystack There are a few things that have to be updated, but I could push the code in the following days for you to take a look

kr15h commented 6 years ago

The sudo apt-get install's are installing the SDL game engine. It is needed in order to make the gamepads to work on the Raspberry Pi