Wiring up servos will look similar to wiring up sensors, except the signal maps to an output. Wiring up a motor is similar to wiring up an LED.
To wire up a servo, you'll have to use a setup similar to the following figure:
After wiring up the servo, plug the board in and listen to your servo. If you hear a clicking noise, quickly unplug the board—this means your servo is trying to place itself in a position it cannot reach. Usually, there is a small screw at the bottom of most servos that you can use to calibrate them. Use a small screwdriver to rotate this until it stops clicking when the power is turned on.
This procedure is the same for continuous servos—the diagram does not change much either. Just replace the regular servo with a continuous one and you're good to go.
Wiring up motors looks like the following diagram:
Again, you'll want the signal pin to go to a PWM pin. As there are only two pins, it can be confusing where the power pin goes—it goes to a PWM pin because, similar to our LED getting its power from the PWM pin in Chapter 2, Working with Johnny-Five, the same pin will provide the power to run the motor.
Now that we know how to wire these up, let's work on a project involving a motor and Johnny-Five's REPL.