伺服电机
R2026b读取和写入连接到 Arduino® 硬件的伺服电机
在使用伺服函数之前,请使用 arduino 创建一个 Arduino 对象。有关详细信息,请参阅Connect to Arduino Hardware。
您可以使用 Arduino 资源管理器以交互方式配置伺服电机,并使用该接口在 MATLAB® 和 MATLAB Online™ 中对连接到 Arduino 或其他受支持硬件的伺服电机读取和写入位置。
有关安装版 MATLAB 中支持的硬件的完整列表,请参阅Supported Hardware。有关 MATLAB Online 支持的板、工作流和平台的详细信息,请参阅Get Started with MATLAB Online for Arduino。
函数
servo | Connection to servo motor on Arduino or ESP32 hardware |
readPosition | Read servo motor position |
writePosition | Write position of servo motor |
主题
- Rotate a Servo Motor
Learn how to rotate a servo motor using MATLAB commands.
- Control Servo Motors
This example shows how to use the MATLAB® Support Package for Arduino® Hardware to control a hobby servo motor.
- Servo Motors
Learn about servo motors.