The net has a lever type micro switch I think.
It would have been nice to mention this particular detail in the original post.
Forget IR sensors -- use that switch.
If the switch has two tabs, connect one to ground and the other to the encoder input.
If the switch has 3 tabs, two of them were connected.
- Connect ground to Common. (COM)
- Connect the encoder input to Normally Open. (NO)
Wiring details/diagrams in the FAQ found in the wiki. (link in menu bar above)
I’m not sure how to connect that switch to the computer with the 3 buttons he mentions, and run the program to recognize those inputs.
You need a encoder that sends keystrokes like an
I-Pac2 or an Arduino running a keyboard sketch/firmware.
When the microswitch lever is pressed, the switch closes, ground is applied to the encoder input, and the encoder outputs the associated keystroke via USB to the computer running the software.
Default buttons:
Up Arrow: Up
Down Arrow: Down
Right Arrow: Start
A: Basket 1 trigger
S: Basket 2 trigger
You'll need pushbuttons for Up, Down, and Right Arrow wired to the encoder to select and start games.
If you use an I-Pac:
- "A" is input "2 SW 1". (MAME Player 2, Button 1 default)
- "S" is input "2 SW 2". (MAME Player 2, Button 2 default)
- Arrow keys are the associated P1 joystick inputs.
BTW, some pics of your cab would probably make it easier for forum members to help with further suggestions.
Scott