Help with GUI matlab to control a servomotor
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
FRANCISCO JOSÉ DEL MORAL CONDE
el 23 de Abr. de 2020
Comentada: FRANCISCO JOSÉ DEL MORAL CONDE
el 23 de Abr. de 2020
Hi, I would like to know if someone could help me to solve this error: "MATLAB connection to Uno at COM3 exists in your workspace. To create a new connection, clear the existing object."
I am working with a slider to move a servomotor and I don´t know how to solve it, I have tried to "clear all" in the last line of the function and it still no working. This is the code:
% --- Executes on slider movement.
function slider1_Callback(hObject, eventdata, handles)
global position
global pos
position=get(handles.slider1,'Value');
pos=double(position);
assignin('base','pos',position);
a = arduino('COM3','Uno','Libraries','Servo');
assignin('base','arduino',a);
s = servo(a,'D2');
assignin('base','s',s);
writePosition(s,pos);
Respuestas (0)
Ver también
Categorías
Más información sobre Interactive Control and Callbacks en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!