A computer can control a motor — Computing, 4–6
A computer can send a signal that makes a motor turn, stop or change direction. This is how code can make a toy car move or a small robot wave.
A signal can make movement happen
A motor is a small machine that turns. A computer cannot push a wheel with its own hands, so it sends an electrical signal to the motor. The signal can tell it to turn, stop or turn the other way, and the motor changes that message into movement.
Why connect code to a motor?
People wanted machines to do jobs that need movement, such as turning wheels, lifting parts or opening a door. A motor can provide the strength, but it needs a controller to know when and how to move. Code gives the controller repeatable directions, so the machine can act without someone touching it each time.
Making a toy car move
Suppose a toy car has two motors. First, the computer sends “turn” to both motors for three seconds, so both wheels move and the car goes forward. Next, it sends “stop” to both, so the car stays still. If it turns only the left motor, the car curves instead of travelling straight.
A motor is not the whole robot
It is easy to think that a motor knows what to do because it is the part that moves. That makes sense when you see the wheel turning. In fact, the motor usually only follows a simple signal; another part, running code, decides when to send it and for how long.
Where computers move things
You meet computer-controlled motors in toy vehicles, lifts, automatic doors and some washing machines. In a factory, motors can move a box along a belt. The computer chooses the timing, while the motor supplies the turning force; each is doing a different job.
Keep exploring
Other languages
Loading MyLeoNes™…