SegaController is an open-source Arduino library to enable your Arduino sketches to read Sega Genesis / Mega Drive controllers.

It supports both 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.

And if you’re interested, I’ve also documented How To Read Sega Controllers.