Capítulo 3 INTERPRETACIÓN MUSICAL
3.4 Los instrumentos musicales
Patterns of on and off can represent numbers. Likewise, numbers can represent other things.
For example, the letter A can be represented by the number 0, B by 1, C by 2, and so on. In fact, A is normally represented by the number 65 and B by 66. Lower-case a is 97. This particular letter coding is part of the American Standard Code for Information Interchange, or ASCII, code. In ASCII, my name ‘‘Edwin’’ is the sequence of numbers 69, 100, 119, 105, 110.
It’s not much of a reach, then, to imagine that we can use numbers to represent commands to the computer. 0 could be, for example, halt. 1 might be load a value, and 2store a value.
It would be the subject of a whole book, if not more, to trace the progression from switches and lights to full computers. However, any digital computer you have ever used operates using a small handful of very simple operations, performed by electronic circuits, on values of one and zero.
The holes punched into tape or cards were read by little switches. These switches created voltages inside the early computers, and these voltages were stored in circuits. Sometimes the circuits would cause the voltages to be converted into magnetic patterns on magnetic disks or tapes, other times they might trigger machinery to punch holes in some tape.
The patterns of voltages, the patterns of on and off, flow through the computer’s circuits to create different patterns of on and off. This all happens very quickly, since electrons act very quickly, and can seem like magic. But inside the computer there are only many tiny electronic switches, switching on and off.
LEGO RCX
Leaping ahead several decades of research and development, you will find that numbers can represent complex instructions to a robot, for example. Looking at Fig. 7-13 you can see four ‘‘blocks’’ connected together. This is one way to represent a program that is easier on the eyes than a stream of numbers, binary, hex, or otherwise. Underneath it all, however, it is still a set of binary patterns.
The top block represents the starting point, which for this simple example is labeled ‘‘Untitled.’’ The next block represents a command to the robot to
move forward for one second. Then you have the command to turn left for a second, and finally another second of forward motion.
If you have used the LEGO Mindstorms at all, you will recognize this as a primitive program. You can even build the Roverbot in the Mindstorm instructions and run this program on it.
Thinking back to the beginnings of this chapter, this program could be created by two cams on a slowly moving shaft.
The first cam would be the ‘‘forward’’ cam, and would have a bump that would press a switch that makes the robot move forward by supplying power to both of its motors. The size of these bumps, for there would be two of them, would be large enough so the switch was pressed for exactly one second.
The second cam would be the ‘‘turn left’’ cam. Its switch could make the robot turn left by supplying power to only the right-hand motor.
How would this two-cam system look? How would you wire the switches to power the motors to make it match the behavior of this program?
Summary
We started by looking at how limit switches can be used to affect the behavior of a mechanical system. In the process, we learned about different kinds
Fig. 7-13. Action blocks.
CHAPTER 7
Sequencing and Programs
of switches. By moving the switches away from the machine and then controlling them using a set of rotating cams, we saw how we might control behavior in more complex ways.
Of course, rebuilding parts of your machine to change the programming is cumbersome, so we looked at different ways to represent our sequences of on and off. This led us to punched cards and tape.
From there we looked at how patterns of on and off can represent numbers, and how these numbers can be used to represent other things, such as instructions to a computer. And what are instructions to a computer if not a program? So programs are numbers, which are simply patterns of zero and one. And what are ‘‘zero’’ and ‘‘one’’ if not the open and closed position of switches? And we are back to the beginning again.
Quiz
1. List as many types of switches as you can.
2. What is a common mechanism used to control automata?
3. How were early computers, and even earlier looms, programmed? 4. You walk into your bathroom and see that there are eight lights above
the mirror. From left to right, the light bulbs are On, Off, On, On, Off, Off, On, On. Write this down in binary and decode it. What number does it represent?
5. If you were going to invent a simple computer language, what types of commands would you use?
8
CHAPTER
Joints
Introduction
Chapter 3 focused on machines that manipulate force. These machines implied motion—the pivot of the lever, the turning of the gear, even the sliding of the block on a ramp. But these motions were secondary to the main focus, which was the study of the forces involved. This chapter, and the next, focus on the motion itself.
While a loose object moves when you apply force to it, robotic machines need more controlled motion. The pieces all need to be connected, and their motions constrained into useful patterns.
At the point where two rigid parts are attached, where they move relative to each other, there is a movingjoint. This chapter is concerned with these moving joints, such as the hinge and the pivot. The basic types of joint allow bending motion, sliding, rotation, and even some complex movements.