Arduino - Servo Library
This library allows an Arduino board to control RC (hobby) servo motors. Servos have integrated gears and a shaft that can be precisely controlled. Standard servos allow the shaft to be positioned at various angles, usually between 0 and 180 degrees. Continuous rotation servos allow the rotation of the shaft to be set to various speeds.
The library was included in Arduino IDE. It can be used without the need to install the library.
This image is created using Fritzing. Click to enlarge image
Example of Servo Motors
The library works with all standard servo motors. For example:
- MG996R - Metal Gear Torque Servo Motor for high weight application
- SG90 Micro Servo Motor for low weight application
This library is compatible with the avr, megaavr, sam, samd, nrf52, stm32f4, mbed architectures so you should be able to use it on the following Arduino boards:
※ NOTES AND WARNINGS:
- The Servo library supports up to 12 motors on most Arduino boards, 48 on the Arduino Mega, and 60 on the Arduino Due .
- On boards other than the Mega, use of the library disables analogWrite() (PWM) functionality on pins 9 and 10, whether or not there is a Servo on those pins.
- On the Mega, up to 12 servos can be used without interfering with PWM functionality; use of 12 to 23 motors will disable PWM on pins 11 and 12.