Difference between revisions of "Vector Pong"

From Bloominglabs
Jump to: navigation, search
(removed excess '['s and ']'s)
m ("August" should be capitalized)
Line 1: Line 1:
Vector Pong is a simple Pong clone built from an Arduino and a 1960's Heathkit oscilloscope. The first version was built in a single night on Friday-Saturday, august 26-27 2016.
+
Vector Pong is a simple Pong clone built from an Arduino and a 1960's Heathkit oscilloscope. The first version was built in a single night on Friday-Saturday, August 26-27 2016.
  
 
For input, the Arduino reads two potentiometers with two of its analog inputs. The potentiometers are built into the simplest "controller" I could build: they are screwed into tongue depressors.
 
For input, the Arduino reads two potentiometers with two of its analog inputs. The potentiometers are built into the simplest "controller" I could build: they are screwed into tongue depressors.

Revision as of 21:21, 13 November 2016

Vector Pong is a simple Pong clone built from an Arduino and a 1960's Heathkit oscilloscope. The first version was built in a single night on Friday-Saturday, August 26-27 2016.

For input, the Arduino reads two potentiometers with two of its analog inputs. The potentiometers are built into the simplest "controller" I could build: they are screwed into tongue depressors.

Internally, the Arduino keeps track of where the two paddles are, where the ball is, how fast the ball is moving in the X direction and in the Y direction, and the players' scores. Roughly 60 times per second, the Arduino recalculates the locations and velocities, and generates an array of dots, stored as [X,Y] coordinates. During the intermediate time, the Arduino outputs these [X,Y] pairs sequentially, drawing dots to the screen.

For output, I built two 6-bit resistor ladders and attached them to 12 of the Arduino's 14 GPIO pins. These resistor ladders allow the Arduino to produce analog voltage values corresponding to the X and Y coordinates of a dot. The oscilloscope is placed in [X,Y] mode, and its inputs are attached to the resistor ladders' outputs.

Originally, I tried using the Arduino's PWM to generate analog voltages without additional hardware or software. Unfortunately, the Arduino's PWM runs at about 460 Hz, which the oscilloscope is easily able to display. I then tried to implement my own output, with Pulse-Density Modulation in a tight loop. Unfortunately, recalculating the densities of the pulses took long enough that the display would stutter. In the end, I spent a couple of hours carefully glueing and wiring resistors to 0.1" headers.

The 6-bit ADCs allow for a "resolution" of 64x64 dots. By putting the oscilloscope out of focus, the image appears fairly smooth.

While building the resistor ladders, I learned a little bit on the topic of resistor precision.

Personal tools