Main Content

Servo Motors

R2026b
Read and write to servo motors connected to Arduino® hardware

Create an Arduino object using arduino before you use servo functions. See Connect to Arduino Hardware for more information.

You can use Arduino Explorer to interactively configure servo motors and use the interface to read and write position to the servo motor connected to Arduino or other supported hardware in MATLAB® and MATLAB Online™.

For a complete list of hardware supported in the installed version of MATLAB, see Supported Hardware. For more information regarding supported boards, workflows, and platforms supported on MATLAB Online, see Get Started with MATLAB Online for Arduino.

Functions

servoConnection to servo motor on Arduino or ESP32 hardware
readPositionRead servo motor position
writePositionWrite position of servo motor

Topics