run DC motor with Matlab GUI and Arduino
4 次查看(过去 30 天)
显示 更早的评论
Hi, I want to run a DC motor and L298N motor driver with Matlab GUI and Arduino. I use a 5 radio button and one push button. # radio button in one panel which are low speed, medium speed and high speed. While another two is clockwise(CCW) and anticlockwise(ACW). I also have a timer which sends how long the motor will rotate. I already try to code, no error but my motor does not rotate. Attached is my GUI and code.
0 个评论
回答(1 个)
cesar quirino
2018-5-23
% --- Outputs from this function are returned to the command line. function varargout = TABLEROMANDO_OutputFcn(hObject, eventdata, handles) % varargout cell array for returning output args (see VARARGOUT); % hObject handle to figure % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure varargout{1} = handles.output; clear all, global a; a=arduino('COM3'); a.pinMode(6,'output');
% --- Executes on button press in pushbutton1. function pushbutton1_Callback(hObject, eventdata, handles) % hObject handle to pushbutton1 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) global a; a.analogWrite(6,20); pause(0.5);
0 个评论
社区
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Arduino Hardware 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!