Arcade Output | Plugin

Built into the "MAME Current" core of RetroArch, the Serial I/O plugin allows raw serial output over USB. This is the most granular but most technical option. You write your own Arduino sketch that listens for specific keywords ("COIN_LOCKOUT," "LED_1").