From the course: Learning Arduino: Pulse Width Modulation

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Controlling a continuous rotation servo with an analog input

Controlling a continuous rotation servo with an analog input - Arduino Tutorial

From the course: Learning Arduino: Pulse Width Modulation

Start my 1-month free trial

Controlling a continuous rotation servo with an analog input

- Controlling a continuous rotation servo is slightly different than controlling a basic hobby servo. When a value of zero is sent to the servo, the servo spins at full speed in one direction. On most servos, this will be anti-clockwise. When a value of 180 is sent to the servo, the servo spins at full speed in the other direction. Again, this is normally clockwise. However, around the value of 90, the servo stops. I stress around, because most continuous rotation servos will be a little off. I have tested my servo and know that a value of 90 makes it stop spinning. I did this by manually trying different numbers. Any number higher than 90 makes the servo spin clockwise, while any number lower than 90 makes it spin anti-clockwise. In the Arduino IDE, I will select File, Examples, Servo, Knob. Now, this is the exact same code that we used to control the basic hobby servo. Because the value range used to control a basic hobby servo and a continuous rotation servo are exactly the same, I…

Contents