Homepage › Forums › RetroPie Project › Controller Configuration in RetroPie › Teensy controller – manually write controller config file
Tagged: controller config, floob, manually, retroarch
- This topic has 15 replies, 2 voices, and was last updated 9 years, 5 months ago by rasmushauschild.
-
AuthorPosts
-
06/30/2015 at 14:45 #101083rasmushauschildParticipant
Hi, I have made a custom gamepad/controller using an Arduino type called Teensy. For some reason The auto-controller-configuration in retropie does not save my configuration-file in the /opt/retropie/configs/all/retroarch-joypads directory. Therefore I would like, to write the file manually. How do I do this? Do I just edit one of the pre-configured controller files to the right name, button-numbers and hotkeys?
Thanks06/30/2015 at 20:44 #101110FloobMemberDoes the jstest output tell you the button mappings?
Is it like this?
http://www.instructables.com/id/SNES-Teensy-USBPS3-Gamepad/06/30/2015 at 22:12 #101119rasmushauschildParticipantHi.
The jstest displays all the buttons and analog axes and their number/mapping.
Yes, the teensy board that i’m using is just the same as in that toturial. However I didn’t write my script in HEX, but in the Arduino IDE. Also my controller has been made from parts, if that makes any difference :)
Tank you in advance06/30/2015 at 22:41 #101122FloobMemberHere is an example file that should be placed here:
/opt/retropie/configs/all/retroarch-joypadshttp://pastebin.com/raw.php?i=vYP9xSeF
You can get the input_device value by looking at the “iproduct” value.
use “lsusb -v”
Or for a specific device, like this
“sudo lsusb -D /dev/bus/usb/001/004”because mine is the 4th device on the usb bus
Anyway… not sure if it will work but you can try.
07/01/2015 at 09:15 #101147rasmushauschildParticipantHi again. To get the iproduct value, should I just try to type lsusb -v in the home directory? The file that you’re linking to is the USBGamepad.cfg in /opt/retropie/configs/all/retroarch-joypads right?
If so, I only see “code” for one directional control, and my gamepad has both an analog thumbstick and a controll cross. I believe, that the axes up, down, left and right in the USBGamepad.cfg file are for a control cross? Can I add an analog thumbstick to the USBGamepad.cfg file? If so, then how?
Thanks07/01/2015 at 20:21 #101175FloobMemberTo test the principle lets just try the buttons first.
whats your output when you type lsusb ?
07/01/2015 at 21:31 #101179rasmushauschildParticipantSure :)
When i type lsusb with the Teensy gamepad plugged in it says:
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 004: ID 413c:2107 Dell Computer Corp.
Bus 001 Device 005: ID 16c0:0487 VOTI Teensyduino Serial+Keyboard+Mouse+JoystickThe Bus 001 Device 005 is my gamepad
Also I think I might know why retroarch won’t save the controller config-file. Could it be because the name of the gamepad (TeensyduinoSerial/Keyboard/Mouse/Joystick) includes “/”? I think that Retroarch gets confused, and thinks that the name of my gamepad is a directory. However in the output, when I type lsusb, all “/” are replaced by “+”.
What do you think, could this be the reason why Retrach doesn’t save my gamepad config-file?
Thank you in adavnce07/01/2015 at 21:58 #101182FloobMemberOk, now try
“sudo lsusb -D /dev/bus/usb/001/005″
and look for the iProduct value.
And can you screenshot the jstest output as well?
07/01/2015 at 22:39 #101190rasmushauschildParticipantThe iProduct “value” is: 2 Serial/Keyboard/Mouse/Joystick
the Jstes is almost unreadeble on my Mac, so I also took picture of the screen with the raspberry pi. I’ll upload both. Also when I move the thumbstick all the text and values scroll down the screen – not like the jstest I can do with my SNES USB gamepad.Also in my last post I wrote: Could it be because the name of the gamepad (TeensyduinoSerial/Keyboard/Mouse/Joystick) includes “/”? I think that Retroarch gets confused, and thinks that the name of my gamepad is a directory. However in the output, when I type lsusb, all “/” are replaced by “+”.
What do you think, could this be the reason why Retrach doesn’t save my gamepad config-file?Do you have any idea if this could be the case?
Thanks07/01/2015 at 22:53 #101195rasmushauschildParticipantHi, it seems like I can’t upload any images to this forum…
I have uploaded both images of the jstest on my own website: http://minifactory.dk/test.html
sorry for the delay :)07/01/2015 at 23:18 #101198FloobMemberYou could put this file in:
/opt/retropie/configs/all/retroarch-joypadsI think you can call it anything – try “joypadtest.cfg”
It may well need a different driver nameinput_device = "2 Serial/Keyboard/Mouse/Joystick" input_driver = "udev" input_up_axis = "-1" input_right_axis = "+0" input_down_axis = "+1" input_left_axis = "-0" input_a_btn = "13" input_b_btn = "14" input_x_btn = "15" input_y_btn = "999" input_l_btn = "3" input_r_btn = "4" input_start_btn = "7" input_exit_emulator_btn = "7" input_select_btn = "6" input_enable_hotkey_btn = "6"
Although this implies you may be better outputting keyboard keys from the Teensy:
https://forums.adafruit.com/viewtopic.php?f=8&t=58901What you want is yellow text at the bottom of the screen when you start a retroarch based game, indicating it has found the joypad.
Yes, you could be right about the / marks in the name – do you have a file here?
/home/pi/.emulationstation/es_temporaryinput.cfg ?07/01/2015 at 23:42 #101199rasmushauschildParticipantHi, I’ll try that config-file tomorrow.
Thank you so much, for putting this much effort into helping me out! :)A very important thing for me is to have a full analog thumbstick, since I love n64 games. And I don’t think you can have that, if the Teensy is programmed as a keyboard, but I might be wrong?
In the directory “/home/pi/.emulationstation/es_temporaryinput.cfg” there is a configuration-file for my keyboard. i’ve posted a picture of the file here: http://minifactory.dk/test.html
Thanks again :)07/01/2015 at 23:45 #101200FloobMemberMaybe tomorrow unplug your keyboard and boot into ES again – then re-post that temp file as it should catch the teensy settings then.
07/01/2015 at 23:47 #101201rasmushauschildParticipantSure, thanks
07/02/2015 at 09:33 #101216rasmushauschildParticipantHi, I tried to create the new “joypadtest” in /opt/retropie/configs/all/retroarch-joypads. At first it didn’t work, but I then changed the iproduct/name to the one shown in jstest, and it worked! I got the yellow text, and my gamepad was fully functional in any retroarch game! Now the only thing left to do is to get the analog thumbstick to work. Could I just copy-paste the part, coding for the analog joypad from another config-file in /opt/retropie/configs/all/retroarch-joypads?
Now it’s the teensy, that is in the “/home/pi/.emulationstation/es_temporaryinput.cfg”.
Here’s the new picture: http://minifactory.dk/test.html
You’ll see, that it has only 2 analog axes from the thumbstick, this is because it wont let me register both up and down or left and right in emulationstation, however in the retroarch controller setup/configuration it will sometimes accept all directions.
Thanks07/03/2015 at 09:11 #101265rasmushauschildParticipantHi, So I actually got the thumbstick working, by copying and pasting the analog thumbstick code from a PS3 controller-config file. But when I try to walk around in super mario 64 he’s walking so slow. I think this is because my thumbstick is the same as you would find I a PSP (it’s very small compared to a regular thumbstick).
So how can I change the code, so retroarch knows the max value of the thumbstick (so that when I press it all the way the forward Mario will run (as if played with an original n64 gamepad) instead of walking very slow.
Thanks -
AuthorPosts
- The forum ‘Controller Configuration in RetroPie’ is closed to new topics and replies.