mholgatem / GPIOnext

The next evolution of GPioneer! Create virtual gamepads with your GPIO pins!
MIT License
138 stars 37 forks source link

request - I2c functionality for extra Gpios #1

Closed levimadeley closed 7 years ago

levimadeley commented 7 years ago

request to add I2c functionality - add an adc / mux for extra pins for 2 player setups(just for start, select, coin, exit buttons) - And here's why..

i built an arcade console, using a pi3 and Gpioneer.. I'm using PiSupply using pins 23 & 24 for startup and soft shutdown of the pi. problem is im now atleast 2 pins short for the standard 2 player setup if i was to use an ADC on pins 3 & 5 i believe this would solve this issue, for start, select, coin, exit, not for player keys(due to any delay that may be introduced) i love Gpioneer and its easy to use, the only thing holding this up is the limited number of pins on the pi3 - 8 ground pins ? really? lol... (i simply am not smart enough to get pins 27 & 28 to work at all)

mholgatem commented 7 years ago

It's a good suggestion, but I probably won't be working on it anytime soon as my day job has me pretty busy at the moment. You can always use combos to simulate having extra pins. For example, pin 3 = 'A', pin 5 = 'B', pin 3+5 = 'C'.

With combos, you can essentially set aside one 'shift' pin for each player to work as follows:

PLAYER 1: 'SHIFT PIN'=37 UP=3 DOWN=5 LEFT=7 RIGHT=11 A=15 B=13 X=19 Y=21 LSHOULDER=29 RSHOULDER=31

START=SHIFT+A (37+15) SELECT=SHIFT+B (37+13) COIN=SHIFT+X (37+19) EXIT=SHIFT+Y (37+21)

PLAYER 2: 'SHIFT PIN'=40 UP=8 DOWN=10 LEFT=12 RIGHT=16 A=18 B=22 X=26 Y=32 LSHOULDER=36 RSHOULDER=38

START=SHIFT+A (40+18) SELECT=SHIFT+B (40+22) COIN=SHIFT+X (40+26) EXIT=SHIFT+Y (40+32)

To use the shift pin technique, you can either wire each shifted button to 2 pins (plus ground pin), or you can wire 1 button to act as your 'shift' button and just require the player to press the 'shift' button + another button at the same time.