JoyLite Maze‎ > ‎

How To: JoyLite Maze

This page contains the detailed instructions on how to create your own JoyLite Maze.

To get started, you will need:
Arduino Duemilenove with USB Connector to load programs
UART SB + USB connector
Atari Joystick (plentiful on eBay)
Hookup wire (24 gauge) (RadioShack)
Heatshrink tubing (or your preferred way of joining wires -- breadboard, perhaps) (RadioShack)
Wire strippers (RadioShack, or equivalent)
1) Test your hookups
 a) Ensure the rainbowduino power switch is in the proper (UP) position
b) Stack the RGB LED Matrix on top of the rainbowduino. On its sides, the LED Matrix has little notches that are either set in, or pushed out from the plastic body.
Position the Rainbowduino so that the text on the PCB is facing you, rightside up. Position the Matrix so the "Notched-OUT" side is to the left. Gently push the Matrix pins into the rainbowduino.
c) Plug the 2-PIN JSP Power connector into the rainbowduino, and the other end of the power connector into the 5V and GND. You may need to use some of the heatshrink tubing and hookup wire to give your wires a bit more length.

d) Connect the arduino to power by using a USB connection to a computer
e) Expected result: Test pattern should appear on the 8x8 LED Matrix 

2) Determine the Atari joystick wire assignments
Atari joystick wire colors are fairly inconsistent in my experience (except for the black wire always being GND), so we can't reliably say for example, "the red wire is always up". We need to do some diagnostics on the joystick to determine which wires correspond to which joystick commands.
a) Cut off the end of the Atari joystick cord and strip about 3" of the black insulation off. You will find 6 wires. Black will go to GND, but we need to figure out which joystick command is assigned to each of the 5 remaining wires (Up, Down, Left, Right, Button Press).
At this point, you will find it useful to attach some 24 gauge wire to the ends of each wire. The atari joystick wires are a fairly thin, stranded type. So plugging those into the arduino ports would be a challenge. Heatshrink tubing is useful for this step.

b) Unplug the rainbowduino power from the arduino and plug the black wire from the atari joystick into the arduino GND, and plug in all non-black joystick wires to the arduino digital ports 2,3,4,5 and 6

c) Load the Atari Detection Sketch (below) onto the arduino. This program will write ON/OFF values to the Serial line and you'll be able to see them displayed in Hyperterminal.
bool val2;
bool val3;
bool val4;
bool val5;
bool val6;
void setup()                  
  pinMode(2, INPUT); 
  pinMode(3, INPUT); 
  pinMode(4, INPUT); 
  pinMode(5, INPUT); 
  pinMode(6, INPUT); 
  digitalWrite(2, HIGH);
  digitalWrite(3, HIGH);
  digitalWrite(4, HIGH);
  digitalWrite(5, HIGH);
  digitalWrite(6, HIGH);
void loop()                  
  val2 = !digitalRead(2) ;   
  val3 = !digitalRead(3);   
  val4 = !digitalRead(4) ;  
  val5 = !digitalRead(5);   
  val6 = !digitalRead(6);   
d) On your computer, open Hyperterminal (Start->Programs->Accessories->Communications->HyperTerminal) and set up your arduino connection. Use the following configuration:
Connect Using: (Whatever COM Port your programming IDE recognizes your arduino under)
"Configure..." Button
Bits per second: 9600
Data bits: 8
Parity: None
Stop bits: 1
Flow control: Hardware
e) In Hypterteminal, connect to the arduino (the toolbar button that looks like a telephone). You will see rows of "00000" start to appear. Move the joystick and see how some of the 0's change to 1's. This reveals which color wires correspond to which joystick commands.
Make a note of which values become "1" when you move the joystick in a particular direction. The output is in the format: (pin 2)(pin 3)(pin 4)(pin 5)(pin 6).

Note: You don't have to use this technique to determine the joystick wire assignments. You could also connect digital ports 7-11 on the arduino to 5 LED's on a breadboard and use digitalWrite (instead of Serial.print) to determine which digitalReads cause which LEDs to light up.
3) Load rainbowduino and arduino software
a) Download the code package at
b) Plug UARTSB into rainbowduino.
UART SB Rainbowduino 

c) Hook up UART SB to computer via USB cable and transfer the sketch from the code package Rainbow_CMD_V2_0 to the rainbowduino.
d) Hook up arduino via USB connection to the computer and transfer the sketch from the code package SeeedMaster_maze2 to the arduino.
4) Connect atari joystick wires to arduino digital ports
 Atari wire  Arduino Digital Pin
 Down 3
 Right 4
 Up 5
 Left 6
 Ground (Black) GND 
You will have 1 stray wire, and that's okay. That's the wire that controls the button signal.
5) Connect arduino to rainbowduino
 Arduino  Rainbowduino
 Analog 4 SDA
 Analog 5 SCL 
 5V Power Jumper (Red wire) 
 GND Power Jumper (Black wire)
Congratulations! Now, when you provide power to the arduino, a maze will be automatically generated and you will be able to use the joystick to navigate it. To generate a new maze, press the reset button on the arduino.
With some processing language knowledge, you should be able to reverse engineer the code to begin programming some different behaviors.

(Not pictured but later added)
You can connect that stray wire to the RESET pin (next to the V3 pin on the Arduino) and the Atari Joystick button will make a new maze. Genius! Thank you! Thank YOU!

Questions or comments, please contact me at joetcochran AT gmail DOT com