Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Programa Matlab
Programa Matlab
% *************************************************************
%PROGRAMA QUE CONTROLA LAS ARTICULACIONES DE UN BRAZO ROBOT
%DE CINCO GRADOS DE LIBERTAD
% *************************************************************
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
% --- Outputs from this function are returned to the command line.
function varargout = servo_control_OutputFcn(hObject, eventdata,
handles)
varargout{1} = handles.output;
%********PROGRAMACIN PRINCIPAL*-*-*-*-*-*-*-
%CONTIENE:
%CONTROL DE LOS SLIDER QUE ENVIAN DATOS SERIALES
%AL MICROCONTROLADOR PIC 16F628A
% ----------- MOVIMIENTO DE LA MUECA-PIN 4-------------------
function motor_uno_Callback(hObject, eventdata, handles)
set(handles.motor_uno,'Enable','inactive')
val_s=round(get(hObject,'Value'));
grados=round((val_s*0.9)-45);
set(handles.pos_1,'String',grados);
fprintf(handles.SerPIC,'%c',[char(4) char(val_s)]);
pause(0.7)
set(handles.motor_uno,'Enable','on')
%----------------------------------------------------