Recalbox Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • recalbox.com
    • Gitlab repository
    • Documentation
    • Discord

    GPIO Based controller (Not the same question again)

    Recalbox General
    joypad snes pad
    2
    4
    1208
    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.
    • luiscesjr
      luiscesjr last edited by

      I know this has been asked and answered 100 times, so I am not here to ask about how to connect buttons to the GPIO ports. Originally I wanted to hook up 2 analog sticks to the pi through the GPIOs, that was quite easy in fact, not much coding involved, (Only a adc + a few lines) but to make it useful to Recalbox or RetroPie I had to make those as inputs, maybe for now I won't worry about analogs. In fact it did work with the mk_arcade_joystick binary, but it was not really useful without some changes.   So my question is, can I change or make a GPIO controller based on the mk_arcade_joystick? I  think with some changes I could make the analog inputs x and y readable and exclude for good player 2 and use those GPIOs for player one. Tell me if I am missing anything here...   EDIT.: Oh, and where could I find a full list of all the BTN_START, BTN_B, BTN_A, etc?

      1 Reply Last reply Reply Quote 0
      • digitaLumberjack
        digitaLumberjack Staff last edited by

        Hi, yes you have to modify the module, and recompile it in the recalbox buildroot crosscompile environment. The list of all inputs is located in http://www.cs.fsu.edu/~baker/devices/lxr/http/source/linux/include/linux/input.h?v=2.6.11.8

        1 Reply Last reply Reply Quote 0
        • luiscesjr
          luiscesjr last edited by

          Oh thanks for the handy list code! I'm not as familiar as I'd like to be with Linux, but we are coming along =D. I already started coding and got some neat feedback. Now, one more question,  think I can use the I2C defines on my ADC, right? I am currently using ADC 0804, it's what I could get now on my country... It works somehow, so I guess I can use it...   Anyway, after I am done coding this and make it work, can I ask to push this into the recalbox distribution?

          1 Reply Last reply Reply Quote 0
          • digitaLumberjack
            digitaLumberjack Staff last edited by

            Yes that could be nice. I think you should create a pull request to the mk arcade gpio joystick repository, and i would let users decide what version of the driver they want to use in the recalbox.conf file.

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

            Want to support us ?

            74
            Online

            99.6k
            Users

            28.1k
            Topics

            187.1k
            Posts

            Copyright © 2021 recalbox.com