run DC motor with Matlab GUI and Arduino

4 Ansichten (letzte 30 Tage)
melisa samad
melisa samad am 4 Feb. 2018
Beantwortet: cesar quirino am 23 Mai 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.

Antworten (1)

cesar quirino
cesar quirino am 23 Mai 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);

Communitys

Weitere Antworten in  Power Electronics Control

Kategorien

Mehr zu Arduino Hardware finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by