Wiring the servo to our PWM hat

Wiring the servo to the PWM hat is relatively simple; you need to line up the 3-pin socket of the servo to the column of pins you want. You also need to attach the power leads of the shield to AA battery pack from Chapter 6Using Motors to Move Your Project.

I find that figuring out which pin is ground, then making sure that socket is on the bottom, helps. Ground wires on servos are typically black or brown in color. Then, line up the socket and slide it onto the pins in the first column (pin 0).

We've hooked up our servo and given power to the PWM hat, so let's code up a servo.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.17.162.247