Re: Matlab & AT89S51
I have written some code in Matlab GUI for a button which is to be pressed after the input of angle and selection of a radio button corresponding to either clockwise or anti-clockwise direction:
function move_it_Callback(hObject, eventdata, handles)
ccw_selected = get (handles.ccw, 'Value');
cw_selected = get (handles.cw, 'Value');
angle = str2num (get (handles.angle_value, 'String'));
steps = angle / 15;
port = serial ('COM1', 'BaudRate', 9600);
fopen (port)
fwrite (port, steps);
fclose (port);
guidata(hObject, handles);
Will this work? What changes should be done, if required...?