Filter löschen
Filter löschen

Getting an error using servo function in GUI MATLAB

2 Ansichten (letzte 30 Tage)
hamzah alamoodi
hamzah alamoodi am 22 Dez. 2015
Beantwortet: Walter Roberson am 23 Dez. 2015
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 Kommentar
hamzah alamoodi
hamzah alamoodi am 23 Dez. 2015
Bearbeitet: Walter Roberson am 23 Dez. 2015
clear a;
global a;
clear a;
a=arduino('com4','uno','Libraries','servo');
s=servo(a,5);
writePosition(s,0)

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Walter Roberson
Walter Roberson am 23 Dez. 2015

Kategorien

Mehr zu Arduino Hardware finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by