SegaController is an open-source Arduino library to enable your Arduino sketches to read Sega Genesis (Mega Drive) and Master System (Mark III) controllers.

It supports both 2, 3 and 6-button controllers, and includes example sketches for testing via the serial connection and converting the button presses into Keyboard key presses.

You can download the source and follow its development at SegaController on GitHub.

I’ve also documented How To Read Sega Controllers.