Hardware Reference
In-Depth Information
Figure 8-3:
Voltage drop
against current
for an LED and
resistor circuit.
To make your game, you are going to apply that design to an RGB LED - that is the three
colours built into one package. his means that the sources of light are close together and it
is easy to get them to mix or blend together. Red, green and blue are the three primary
colours, although don't tell the art department. To be more precise, they are the additive
primary colours; that is, when light is added in various amounts in these colours you can
make any other colour. When dealing with paint you are restricting the colours it will relect,
which is known as subtractive colour mixing. he subtractive primary colours are yellow,
magenta and cyan, although they are often inaccurately referred to as yellow, red and blue.
he inal design for the game, as far as the electronics is concerned, is shown in Figure 8-4. It
consists of an RGB LED with two resistors on the cathode of each colour. he anodes of all
three LEDs are connected to +5V. Many RGB LEDs have these connected together inside the
chip and bring out only one anode connection; these are known, not unsurprisingly, as com-
mon anode LEDs. he other type you can get is where the cathodes are common. As you might
guess, these are called common cathode LEDs and are not the type you want for this project.
he other part of the game is the player switches, which are simply wired between the
PiFace's input connections and ground. When they are pressed the input bit reads as a logic
zero. his goes to a logic one when they are released.
Search WWH ::




Custom Search