• Recent
  • Tags
  • Popular
  • Home
  • Docs
  • Register
  • Login
RetroPie forum home
  • Recent
  • Tags
  • Popular
  • Home
  • Docs
  • Register
  • Login
Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

Single GPIO button

Scheduled Pinned Locked Moved Help and Support
gpioexit gamevolume control
11 Posts 6 Posters 4.1k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • O
    obsidianspider @TheGrovesy
    last edited by 2 Sept 2016, 03:07

    @TheGrovesy

    Not to say a GPIO button is bad, but why not just use Select+Start to exit an emulator, and it's built in to RetroArch?

    📷 @obsidianspider

    T 1 Reply Last reply 2 Sept 2016, 06:34 Reply Quote 0
    • T
      TheGrovesy @obsidianspider
      last edited by 2 Sept 2016, 06:34

      @obsidianspider thanks for the information I didn't know that... works great thanks.

      1 Reply Last reply Reply Quote 0
      • Z
        Zigurana
        last edited by Zigurana 9 Dec 2016, 20:35 12 Sept 2016, 19:27

        Ok, this issue has been solved for @TheGrovesy, but I think its still an interesting question.

        Lets say that someone, ahum, had planned and planned and wired up some buttons and in the heat of the moment decided that 4x4 buttons looked much better than a row of 4 and a row 3 three buttons, and therefore well, now has a spare button, but no more connections on his Dragonrise USB to hook it up to. Purely hypothetical, of course, ahum.

        It would be nice to be able to use the button anyway, for instance to work as an universal exit button. The plan was not to use an explicit hotkey anyways. In this situation one would have a mixed controller setup: most buttons would originate from the USB controller, but one from some GPIO interface (PiKeyd?).

        Maybe sending a sigint or sigkill, as was suggested in this thread would be a bit much, plus it would break ES as well when pressed while in ES.

        There is an route discussed by @mike and @jackal123uk here, to use some kind of network commands to 'contact' retroarch from an external source, maybe that is the way to go here? Seems rather heavy-handed for such a small button...

        Any suggestions?

        If tetris has thought me anything, it's that errors pile up and that accomplishments dissappear.

        T 1 Reply Last reply 13 Sept 2016, 08:58 Reply Quote 0
        • T
          TheGrovesy @Zigurana
          last edited by 13 Sept 2016, 08:58

          @Zigurana yes my question about exiting the emulator was resolved. However I would now like to use GPIO to control the volume. So my question about how to map GPIO to functions is still unresolved.

          T 1 Reply Last reply 13 Sept 2016, 11:14 Reply Quote 1
          • T
            tehswiftone @TheGrovesy
            last edited by 13 Sept 2016, 11:14

            @TheGrovesy You can also bind your controller to change the volume. I will have to look at my controller config when I get home from work.

            1 Reply Last reply Reply Quote 0
            • T
              tehswiftone
              last edited by tehswiftone 13 Sept 2016, 20:38

              Add this inside of your controllers config, don't forget to replace button with a proper button ID. This will be similar to exiting an emulator, you will use select + button to use it. So don't worry about it taking up a button on your controller.

              input_volume_down_btn = "button"
              input_volume_up_btn = "button"

              T S 2 Replies Last reply 13 Sept 2016, 20:47 Reply Quote 0
              • T
                TheGrovesy @tehswiftone
                last edited by 13 Sept 2016, 20:47

                @tehswiftone thanks for the info. Where do I find the controller configuration file?

                Also if I really did want to do this with GPIO would it still be done with the same config file?

                T 1 Reply Last reply 13 Sept 2016, 23:19 Reply Quote 0
                • T
                  TheStrayMongrel
                  last edited by 13 Sept 2016, 23:11

                  Its a bit of fiddling around but you could use this @TheGrovesy
                  https://learn.adafruit.com/retro-gaming-with-raspberry-pi/buttons

                  Thats what i use to map gpio buttons to keyboard strokes which run my arcade controls (joysticks, 6 control buttons, 1 and 2 player start and coin buttons, and an exit button) . You'd have to heavily edit the config but would be doable.

                  Raspberry Pi 2 B+

                  1 Reply Last reply Reply Quote 0
                  • T
                    tehswiftone @TheGrovesy
                    last edited by 13 Sept 2016, 23:19

                    @TheGrovesy You should be able to find your controller config inside /opt/retropie/configs/all/retroarch-joypads/

                    No it would not be done in the same file. It's a lot of work for a small gain, not to mention you would have to get up to change the volume :). If you are really itching to learn and want a GPIO project I would recommend setting up power/reset buttons.

                    1 Reply Last reply Reply Quote 0
                    • S
                      SirBilly @tehswiftone
                      last edited by 15 Sept 2016, 02:40

                      @tehswiftone said in Single GPIO button:

                      Add this inside of your controllers config, don't forget to replace button with a proper button ID. This will be similar to exiting an emulator, you will use select + button to use it. So don't worry about it taking up a button on your controller.

                      input_volume_down_btn = "button"
                      input_volume_up_btn = "button"

                      I have mine setup to use Up and Down on the D-pad. Just change the "btn" to "axis".

                      input_volume_down_axis = "+1"
                      input_volume_up_axis = "-1"

                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post

                      Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

                      Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.

                        [[user:consent.lead]]
                        [[user:consent.not_received]]