Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Adding more USBs, a fan, second trigger buttons, and hotkey to the Freeplay CM3
#1
I have everything I need to add more USBs and a fan to the CM3 but as long as I was taking it back apart, I'd like to add a second set of trigger buttons and a hotkey button through the unused GPIO pins.  As far as I can tell, I just wire a button between an unused pin and ground. **Please correct me if I'm wrong**  The part I need help with is coding.  I am not software savvy at all. Could someone please provide instructions on modifying the software to add three more buttons? Also, if there are preferred pins to wire to. Thank you so much! I will post pictures of the final build.
Reply
#2
I believe that you are on the right track here. As far as the code goes, then, I would suggest that you look at the GPIO controller driver code and just get an idea of how it works.

https://github.com/TheFlav/mk_arcade_joystick_rpi

There you can see the "mk_arcade_joystick_rpi.c" file and that the install.sh script adds this line into a "/etc/modprobe.d/mk_arcade_joystick.conf" file:
options mk_arcade_joystick_rpi map=4 gpio=4,17,6,5,19,26,16,24,23,18,15,14,-20

Maybe take a look at that and see if you can make sense of it.
Card Fighters' Clash 2 English Translation ( http://cfc2english.blogspot.com/ )
Neo Geo Pocket Flash Cart and Linker Project ( http://www.flashmasta.com/ )
Avatar art thanks to Trev-Mun ( http://trevmun.deviantart.com/ )
Reply
#3
Interested in adding two additional shoulder (trigger) buttons also.

Nothing fancy, just similar to the X/Y 'without cover' buttons, but at the back. Would like to know how!
Reply
#4
Alright Ed, I've got everything put back together.
http://forum.freeplaytech.com/showthread.php?tid=4554
I have wired bottom right to GPIO 40, bottom left to 41, and hotkey to 42.
If I'm reading your last reply correctly, I can go into that mk_arcade_joystick.conf file and find the line you speak of and just add in the three new GPIO pins?
For example:  mk_arcade_joystick_rpi map=4 gpio=4,17,6,5,19,26,16,24,23,18,15,14,-20,40,41,42


After that, will the controller setup detect the new buttons?.

I just want to make sure I have all my ducks in a row before I start trying to code this.  (never done this before)
Reply
#5
No. You can’t just add extra buttons at the end like that. If I recall correctly the -20 was the hotkey, so you could just edit that. The other ones, you would have to edit the source code and recompile it to add more buttons.

Maybe at some point I could edit the code so that you could just put more values on that line. I don’t know when I would get to that though.
Card Fighters' Clash 2 English Translation ( http://cfc2english.blogspot.com/ )
Neo Geo Pocket Flash Cart and Linker Project ( http://www.flashmasta.com/ )
Avatar art thanks to Trev-Mun ( http://trevmun.deviantart.com/ )
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)