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 - Arduino Tutorial
From the course: Learning Arduino: Pulse Width Modulation
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
(Locked)
Comparing DC motors, servos, and stepper motors2m 44s
-
(Locked)
Implementing basic servo control1m 30s
-
(Locked)
Controlling a servo with an analog input1m 18s
-
(Locked)
Controlling a continuous rotation servo with an analog input2m 6s
-
(Locked)
Controlling DC motor speed with an analog input and transistor2m 49s
-
(Locked)
Diving deeper into H bridge control3m 5s
-
(Locked)
Controlling a DC motor with an H bridge2m 30s
-
(Locked)
Challenge: Controlling a DC motor with an H bridge and potentiometer48s
-
(Locked)
Solution: Controlling a DC motor with an H bridge and potentiometer2m 27s
-
(Locked)
-