Arduino library to read Sega Genesis (Mega Drive) and Master System (Mark III) controllers.
Read Sega Genesis (Mega Drive) and Master System (Mark III) controllers in your Arduino sketches.
The controller pins are as follows, looking face on to the (female) DB9 plug:
5 4 3 2 1
9 8 7 6
There are two example sketches included which make use of the SegaController library. See "File > Examples > SegaController" in the Arduino IDE after installation. Make sure the digital pins you've wired matches those chosen in the code.
This sketch reads the state of a single controller and reports it via the Serial interface. Note that it only reports when the state has changed (a button has been pressed or released). It's good for validating you've got your pins wired up properly.
This sketch reads the state of a single controller and simulates key presses via the Keyboard interface. You can specify which buttons correspond to which keys in the sketch. This sketch requires a 32u4 based board (such as the Leonardo, Micro, or Due).
For details on how SegaController reads the controller's state, see How To Read Sega Controllers.
Copyright (c) 2017 Jon Thysell