Trying to make my own motion control with retropie
TheAtomicFire last edited by
Hi, so I am very aware that I am not providing a lot of details but that is because I do not have my pi / materials with me right now and I am in a bit of a rush to get any instant feedback. I can make a better post about this tommmorow.
For a project at my school, we are utilizing a small breadboard along with some small components (i.e. small ultrasonic sensors) that can be connected to the breadboard. Essentially, we want to be able to try integrating a very rough form of kinect-like motion control (i.e. if you wave your hand in front of the sensor in a certain direction, character on screen will move right)
I have done a good deal of resarch into how to get these parts working on a raspberry pi, and how to make your own control schemes on a raspberry pi, but the only solutions involve either having a pre-defined controllor or basic button connections (i.e. if a connection from pin X is recognized, then the 'right" button is activated)
What i want to be able to do is essentially have a script that is ran to determine when particular buttons are pressed. I plan on using an atari emulator for simplicity, so what i want to do is make a script that, if it detects particular amount of motion from ultrasonic sensor, than the script activates the "right" joystick call and upon getting no value it stops it.
I know that this is all not the best detailed or worded but I really wanted SOMETHING typed out here as opposed to continuing to search the internet to no avail...
how possible is this method of integrating "motion control" and if it is, how can i go about integrating it? ANY feedback would be very helpful
You can use the python-uinput module to create a 'virtual' joystick that will be understood natively by emulators. The connection to your sensor can be handled by the script (read GPIO, USB or serial connection, etc.) and you can simulate a gamepad input with it, based on what data you receive from your sensor.
TheAtomicFire last edited by
@mitu Hi, I never replied to this but I just wanted to say thank you so much. Uinput has been exactly what ive been orking with the past few weeks to try and get this accomplished. However, I have been running into problems getting the gamepad "configured" within retropi. I created cfg file for my "input device" which retopi recognizes, but none of the commands i input through the script actually go through. Do you have any ideas as to how I could implement this? I have been running into a brick wall, and even when looking up these thing nothing really helps.
Regardless, thank you for your help!
However, I have been running into problems getting the gamepad "configured" within retropi. I created cfg file for my "input device" which retopi recognizes, but none of the commands i input through the script actually go through
Do you mean EmulationStation will not recognize and configure your input ? Is your device working with
Do you have any ideas as to how I could implement this?
Difficult to say without any more details or a look at the code you used.