Hardware Reference
In-Depth Information
Make your own switch - such as a pressure pad - and see if you have the same reaction speed
with your feet.
YOUR TURN!
Connect up multiple switches and LEDs and modify the code to make a game. You could have
a different score for each button, or deduct points if you press the wrong button at the wrong
time. You could build your own game as shown in Figure 1-15, which is similar to games in
amusement arcades like whack-a-mole.
When you become more experienced at coding, if you are really adventurous you could create
a network version and play against a friend over the Internet.
Figure 1-15:
My giant
raspberry game.
What Will You Interface?
Computing becomes more interesting when it is connected to the world. Interfacing allows
computers to sense and manipulate the world through inputs and outputs. Most computers
sense the world by detecting a voltage on an input pin, and affect the world by allowing a cur-
rent to flow through an actuator such as an LED or motor. Relays can be considered as an
equivalent to switches, whereas open-collector outputs have to be wired up in a particular way.
With a basic understanding of electricity and the right sensors and actuators you can make the
world a smarter place. As computers become more sophisticated we can build even smarter
solutions. In the future, you might build a robot that would listen for your commands. Or one
day it might even watch what you do and then learn to do the task for you. Although that may
seem complicated to program, as you have seen, computing is about breaking a challenge down
into lots of simple parts, and then each little part becomes solvable.
 
Search WWH ::




Custom Search