servo
R2026bConnection to servo motor on Arduino or ESP32 hardware
Description
Add-On Required: This feature requires the MATLAB Support Package for Arduino Hardware add-on.
A servo object represents a connection to a servo motor on
Arduino® or ESP32 hardware. Attach a servo motor to the appropriate pins on the
Arduino or ESP32 hardware. Create a servo object using the
servo function. You can read from and write to the servo motor in
MATLAB® using object functions.
Note
This object is different from servo, which is for a servo motor
connected to an Adafruit® Motor Shield V2 on the Arduino hardware.
Creation
Description
Input Arguments
Name-Value Arguments
Properties
Object Functions
Use object functions to read from and write to your servo motor.
readPosition | Read servo motor position |
writePosition | Write position of servo motor |
Examples
Alternative Functionality
App
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 any other supported hardware in MATLAB and MATLAB Online™.
Version History
Introduced in R2014b