Giter VIP home page Giter VIP logo

atari50controllers's Introduction

Overview

I started working on this after printing out Mike Mika's Xbox paddle adapter for the "Atari 50: The Anniversary Celebration". I realized I still had some old Atari 800 controllers and thought it might be fun to learn how to use an Arduino Leonardo as a Joystick, Keyboard, and Mouse.

While working on this, I discovered there are already several other projects and products that adapt Atari 8-bit controllers to PC. So it's probably easier fto just buy an existing adapter, but I do this sort of thing for fun. I've been meaning to make custom game controllers for a while now. So this is a nice, easy learning exercise.

This project uses an knockff Leonardo and Matthew Heironimus's Arduino Joystick Library and the Arduino Keyboard and Mouse libraries.

CX30 Paddle Controllers

Each paddle controller has a single fire button and a 1 MĪ© potentiometer with just the wiper and one resistive terminal connected. I originally used the voltage divider described here to estimate the rotation of the paddle knob. One problem with using the voltage divider was the paddle positions affected each others readings. To address this, I've switched to checking the charging time of an RC circuit.
I alternate reading the first and second paddle which seems to eliminate the interference.

I've noticed some problems with this method. Each paddle has a different estimated maximum value. It doesn't seem to affect gameplay much. Another problem is the paddles don't automatically return to a center position. So the sketch may continously send left or right signals while you're navigating your game menu.

CX22 Trackball Controller

My sketch is based on the code found here. The trackball controller should be set to trackball mode but can also function as a joystick.

When in trackball mode, the CX22 figures out both the X and Y direction and rotation speed of the trackball for you. I'm translating the trackball movements into mouse movements and using the button as a 'space-bar' press to match the default fire setup in Atari 50: 5200 Missile Command

If the trackball is set to joytsick mode, the sketch will act like a joystick instead of a mouse and keyboard.

CX20 Driving Controller

The driving controller is a rotary encoder. My implementation is based on this. I added a counter to handle the rotation speed.

CX40 Joystick

The Atari joystick controller is very simple. It has 4 switches that pull down pins 1-4 of the Atari DE9 port a fire button that pulls down pin 6.

The Circuit

This circuit can be found here. It can handle all 4 controller types. The images folder also has simplified circuits that handle the paddle, driving, or trackball/joystick controllers individually. The sketch should work with any of them.

THe circuit lists 5 switches. SW1, SW2, and SW3 are extra game controller buttons. These were added to support games that use more than one button. These buttons are optional if you only play games that use one button. SW4 is a rocker switch. It's used to center the paddle joystick output. SW5 is is a reset button and optional.

The sketch can automatically detect the type of controller attached. I based my detection on Control Freak's description at hackaday.io.
It's not exactly the same. I don't have an Atari keypad and they don't mention the trackball controller.
My sketch will first check for a valid paddle value. If a paddle isn't detected, the sketch checks the joystick direction pins to determine what type of controller is attached. If LEFT and RIGHT pins are detected simultaneously, the controller is a trackball controller. If UP and DOWN are detected simultaneously, it's a driving controller. If only one direction is detected, it's a joystick.

Usage

Plug your Atari controller into the DE9 port on the Leonardo and connect the Leonardo to your PC's USB port.
Move the controller around a bit to let the sketch determine what type of controller is connected.

If you have a paddle controller or joystick controller, the sketch will act like a USB Joystick. The buttons will be mapped to joystick buttons. The paddle controllers will only affect the X axis of the joystick. The second paddle controller will be mapped to a second USB joystick.

If you have a trackball or driving controler, the sketch will act like a Keyboard and Mouse. Based on the games I've played in Atari50, I mapped the fire button to the Spacebar. The three other buttons are mapped to the A, B, and C keys. You can either alter the sketch or remap the controls in Atari 50.

If you want to change the controller, swap it out and press the RESET button on the Arduino. This will restart controller detection.

atari50controllers's People

Contributors

radioation avatar

Stargazers

 avatar

Watchers

 avatar

atari50controllers's Issues

Combine circuits and sketches into a single circuit/sketch

Combined circuit/sketch should automatically detect if a paddle, driving, or trackball controller is connected ( if possible)

  • detect paddle by checking controller pins 5, 9 for valid paddle values
  • detect driving controller if controller pins 1 and 2 are both 'on'

Add three more joystick buttons

Add wiring and code to provide additional fire buttons for games that need it (see Missile Command arcade, Tempest arcade, etc )

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. šŸ“ŠšŸ“ˆšŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.