필터 지우기
필터 지우기

Arduino Error: Too many output arguments

조회 수: 1 (최근 30일)
Halil
Halil 2021년 6월 18일
편집: Bhavya Chopra 2021년 7월 7일
clear all;
a = arduino;
i=0;
while 1
pot=analogRead(a,0)
pot1=analogRead(a,1)
pot2=analogRead(a,2)
pot3=analogRead(a,3)
pot4=analogRead(a,4)
pause(0.5);
if pot4>700
s=servoWrite(a,'D11')
writePosition(s,0);
pause(0.5);
writePosition(s,0.5);
pause(0.5);
writePosition(s,1);
end
i=i+1;
pause(1);
end
Thanks in advance for your help and time!

답변 (1개)

Bhavya Chopra
Bhavya Chopra 2021년 7월 6일
편집: Bhavya Chopra 2021년 7월 7일
The analogRead() method is not a part of the MATLAB Support Package for Arduino beyond release R2013b. For this, as a workaround you can use readVoltage method. It can be used for reading voltage from an analog pin on the Arduino hardware.
Also, please refer to the MATLAB answer attached below which might give you some idea: analogRead() for class arduino
Further, the servoWrite() method is also part of the legacy support package for Arduino. Using the servo method for connecting to the servo motor might resolve the issue for releases R2014b onwards:
s = servo(a,'D11'); % Using servo method for servo object creation

카테고리

Help CenterFile Exchange에서 Arduino Hardware에 대해 자세히 알아보기

태그

제품


릴리스

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by