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
커뮤니티
더 많은 답변 보기: Power Electronics Community
참고 항목
카테고리
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!