SC-Series Servo library for Arduino and ESP32
For usage examples, see the examples directory.
For installation via the Arduino IDE, see docs.arduino.cc.
To install the latest version using arduino-cli
, use the following command:
arduino-cli lib install SCServo
To install a specific version, use the following command:
arduino-cli lib install SCServo@1.0.2
To install an in-development or unreleased version, installation of unsafe libraries must be enabled.
To enable the installation of unsafe libraries, use the following command:
arduino-cli config set library.enable_unsafe_install true
See docs.arduino.cc for more information on the implications.
Once the installation of unsafe libraries is enabled, the SCServo
library may be installed by running the following command:
arduino-cli lib install --git-url "https://github.com/workloads/scservo.git"
This repository provides a Makefile-based workflow to aid in development.
Running make
without commands will print out the following help information:
📚 SCSERVO LIBRARY
Target Description Usage
lint-arduino lint Arduino code using arduino-lint `make lint-arduino`
lint-cpp lint C++ code using cpplint and clang-format `make lint-cpp`
help display a list of Make Targets `make help`
_listincludes list all included Makefiles and *.mk files `make _listincludes`
_selfcheck lint Makefile `make _selfcheck`
vale lint prose with Vale `make vale`
vale-sync sync Vale dependencies `make vale-sync`
The initial version of this library (1.0.1
) represents a direct fork of @waveshareteam/ugv_base_general.
The fork is based on commit 91e5871 and extracts the SCServo
directory from the original repository to allow for easier downstream consumption via the Arduino CLI and IDE.
While the intent of this fork is to remain compatible with the upstream repository, no guarantees are made regarding the stability or compatibility of this library with the original repository.
The code for the SCServo
library is divided into the following
parts:
- communication layer: src/SCS.cpp
- hardware interface layer: src/SCSerial.cpp
- application layer:
- corresponds to the three series of FIT servos
SCSCL
application layer program: src/SCSCL.h and src/SCSCL.cppSMSBL
,SMSCL
, andSTSCL
application layer program: src/SMS_STS.h and src/SMS_STS.cpp
- corresponds to the three series of FIT servos
- instruction definition header file: src/INST.h
- communication layer program: src/SCS.h and src/SCS.cpp
- hardware interface program: src/SCSerial.h and src/SCSerial.cpp
Note that there are differences in the memory table definitions of different series of servos.
New (GitHub) releases of this library are automatically ingressed by the Arduino Library Manager.
A log of currently "visible" releases can be found at downloads.arduino.cc.
For a list of current (and past) contributors to this repository, see GitHub.
Licensed under the General Public License, Version 3.0 (the "License").
You may download a copy of the License at gnu.org/licenses/gpl-3.0.txt.
See the License for the specific language governing permissions and limitations under the License.