필터 지우기
필터 지우기

Getting an error using servo function in GUI MATLAB

조회 수: 2 (최근 30일)
hamzah alamoodi
hamzah alamoodi 2015년 12월 22일
답변: Walter Roberson 2015년 12월 23일
What I'm doing is that I'm trying to control a servo motor using arduino and GUI, the gui has a two push buttons when to make the servo 0 degree and one to make it 90 ... when a press the push buttons it gives me this massage
"Undefined function or variable 's'."
Here is my coding in the opening function
clear a;
global a;
clear a;
a = arduino('com4','uno','Libraries','servo');
s = servo(a,5);
And here is my coding in the two push buttons
writePosition(s , 0); % for 0 degree
writePosition(s , 0.5); % for 90 degree
If anyone can help I would appreciate it
  댓글 수: 1
hamzah alamoodi
hamzah alamoodi 2015년 12월 23일
편집: Walter Roberson 2015년 12월 23일
clear a;
global a;
clear a;
a=arduino('com4','uno','Libraries','servo');
s=servo(a,5);
writePosition(s,0)

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2015년 12월 23일

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by