Hardware Reference
In-Depth Information
THIS PROJECT IS a rather diferent twist on the multiple-choice quiz theme. Not only does
it have a novel way of inputting answers, but it also has a rather novel way of keeping the score.
he idea is that you are going to hack into a slot car game and allow the Raspberry Pi to control
when the game can be played. hen players can drive their cars for three seconds at a time, if
they are the irst to answer a question correctly. If they get the question wrong, their opponent
gets the time. he game continues until one player crosses the inishing line after completing a
set number of laps. he questions come from a plain text ile and can be added to, or the subject
of them changed. hey are multiple-choice questions with four possible answers, and players
indicate their answer by moving a special joystick button. he successful player's joystick but-
ton will light up green, whereas the other player's button will light up red.
Obtaining a Slot Car Racer
So how are you going to implement this game? First you need a slot car racing game. hese
come in all sorts of shapes and sizes, from sleek Formula One racing cars to heavy trucks and
even grannies on Zimmer frames. In essence they are very similar: It's a race between two
players. Mostly they are set up so that if you go too fast at the corners, the vehicle will come
of the track, so it is not just a matter of running the cars at top speed all the time. Normally
the track is some form of igure eight, so the track length can be made the same for both
players. Sometimes the two vehicles cross at the same level, giving opportunities for crashes,
and other times the tracks go over and under each other. Although there are very expensive
racing games, some can be had cheaply in thrift shops or second-hand stores.
Hacking Your Slot Car Racer
You need to hack into your slot car racer, and, as there are lots of diferent types of them, I can't
be too prescriptive about what you need to do. However, from the electrical point of view, it is
basically all the same. What you are going to do is to wire a PiFace relay in series with each hand
controller. his will involve cutting one of the two wires coming from the controller, and con-
necting each end of your cut wire into the NO and common relay connections. NO stands for
normally open - this connection is only connected to the common line when the relay is ener-
gised; when the relay is not energised, that is the normal state - no electrical connection is
made. Figure 14-1 shows how you can do this using a screw connection block. hese are the
type you use for electrical wiring around the house. hey come in various sizes, and the size you
want is the smallest, which is often marked something like 3 Amps. A sharp hobby knife can
slice the two wires apart, and then you can cut one of them; it doesn't matter which one. You
should cut back the insulation and then, following the diagram, attach each end to two of the
connector blocks. Take the other end and run wires of to the PiFace board. Do the same for the
other controller. When you want to play with your slot car game normally you simply replace
the long wires trailing back to the PiFace board with a simple link. Do this close to the track
connections so that you have the maximum length of wire on the hand controllers.
Search WWH ::




Custom Search