simple program to run servo motor using matlab-raspberry pi

Hello, i wanted to run servo motor connected to the raspberry pi 3 b+ hardware with the following program
clear;
rsp = raspi('192.168.43.23','pi','raspi');
m1 = servo(rsp,26,'MinPulseDuration', 1e-3, 'MaxPulseDuration', 2e-3)
while 1==1
writePosition(m1,90)
end
but i'm not getting any output, someone to help me. thanks

回答 (1 件)

Prasanth Sunkara
Prasanth Sunkara 2021 年 2 月 18 日
移動済み: Sabin 2023 年 1 月 9 日

0 投票

It may be possible that you are giving invalid Pulse Duration values when calling the servo function. Confirm the values from the datasheet. Please double check if the pin number you have chosen,26, is connected tightly to the motor and the servo's VCC and especially the GND is properly connect to the pi's GND.
-Prasanth

カテゴリ

製品

リリース

R2019a

質問済み:

2021 年 1 月 30 日

移動済み:

2023 年 1 月 9 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by