3 Electronics
ohsqueezy edited this page 2023-05-16 18:05:49 -04:00

Electronics

Finished breadboard

The platform uses a simple Arduino circuit to send input to the game. This document explains how to create the circuit shown above and load the necessary program onto it. The above image shows a Raspberry Pi in place of the Arduino, but the circuit is identical.

Circuit

Four input pins on the Arduino need to be connected to the game's four input pads, with a 4.7k resistor in each connection.

  1. Add the screw terminals the breadboard, making sure there are four terminals total, with each pin in its own row on the breadboard. In the image above, two components are used, each containing two terminals.
  2. Connect a 4.7k ohm resistor to each terminal pin by placing it in the same row as the terminal.
  3. Finally, connect Arduino pins 2, 3, 4, and 5 to the breadboard using jumper wires, one to each row that ends in a screw terminal (refer to the colored wires in the image above).

Loading the program

Arduino IDE upload

Download the Arduino IDE and connect it to the Arduino. Make sure the Arduino is connected in Tools -> Port. Open the file serial/serial.ino from the Scrapeboard code repository into the IDE. Load the program into the Arduino using Sketch -> Upload.

Testing the circuit

Launch the game without any flags to indicate Arduino mode. Serial data being output by the Arduino will be read over USB. Run the following from the root of the Scrapeboard code repository in the terminal to launch the game (for example, from Powershell on Windows, or Terminal on OS X).

./OPEN-GAME

Each screw terminal corresponds to one of the four metal plates on the platform. Input is sent to the game by connecting any two metal plates using another piece of metal as a conductor, for example, the metal on the underside of the board. For now, use a jumper wire to test the connections between screw terminals. Insert one end of the wire into any terminal, and the other end into any other. The lizard should appear on screen.

⬅ Previous Page Next Page ➡
Software Platform