run DC motor with Matlab GUI and Arduino

4 views (last 30 days)
melisa samad
melisa samad on 4 Feb 2018
Answered: cesar quirino on 23 May 2018
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.

Answers (1)

cesar quirino
cesar quirino on 23 May 2018
% --- 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);

Communities

More Answers in the  Power Electronics Control

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!