matlab error while trying to connect servo motor through arduino
1 次查看(过去 30 天)
显示 更早的评论
if true
a = arduino('com24', 'uno', 'Libraries', 'Servo');
s = servo(a, 'D8')
end
when i run this code i get an error Invalid pin format. Pin number must be a scalar integer.
i am using r2014a version.
Pls help me solve this error
2 个评论
回答(2 个)
Duaner
2016-7-2
I had the same error when trying to read voltage output readVoltage(a,'A1') Invalid pin format. Pin number must be a scalar integer. after messing around i found this to work: readVoltage(a,1)
ans =
4.9951
社区
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Servo Motors 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!