The AtariController library enables your Arduino sketches to read Atari 2600 controllers.
- Download the latest source code zip from https://github.com/jonthysell/AtariController/releases/latest
- Open the Arduino IDE
- Open "Sketch > Include Library > Add .ZIP Library..."
- Select the zip file you downloaded in step 1
There are two example sketches included which make use of the AtariController library. See "File > Examples > AtariController" in the Arduino IDE after installation.
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 more information on how the controllers actually work, see How To Read Atari Controllers.
Copyright (c) 2017 Jon Thysell