In this tutorial we will sweeps the shaft of a RC servo motor back and forth across 180 degrees.
In the following example, I will be showing you how to control servo through channel 1. Given below is the circuit diagram:
A Servo pin has three wires (Order to be connected in evive, left to right)
Angle at the start of the program should be 0 degrees. Then it should increase until it reasches 180 degree angle, then it should decrease until it reaches 0 degree angle.
Arduino uno has 6 PWM pins: 3, 5, 6, 9, 10, and 11 which provide 8-bit PWM output with the analogWrite() function.
We will controlling serov using Pin 3.