Hardware Reference
In-Depth Information
Solution
We'll use the pulse width modulation (PWM) hardware of the Bone and control a servo
motor with the analogWrite() function.
To make the recipe, you will need:
▪ Servo motor (see “Miscellaneous” )
▪ Breadboard and jumper wires (see “Prototyping Equipment” )
▪ 1 kΩ resistor (optional, see “Resistors” )
▪ 5 V power supply (optional, see “Miscellaneous” )
The 1 kΩ resistor isn't required, but it provides some protection to the general-purpose in-
put/output (GPIO) pin in case the servo fails and draws a large current.
Wire up your servo, as shown in Figure 4-1 .
NOTE
There is no standard for how servo motor wires are colored. One of my servos is wired like
Figure 4-1 : red is 3.3 V, black is ground, and yellow is the control line. I have another servo
that has red as 3.3 V and ground is brown, with the control line being orange. Generally,
though, the 3.3 V is in the middle. Check the datasheet for your servo before wiring.
Search WWH ::




Custom Search