How can I send a pwm signal towards a motor with arduino in matlab
11 次查看(过去 30 天)
显示 更早的评论
Hello,
How do I send a PWM signal towards my motor, so that I can control it's speed?
I tried to use analogwrite, because on arduino IDE I can use it to control the motor. But on Matlab I can't use analogWrite, because the command doesn't exist.
I tried to use writePWMDutyCycle, but I couldn't control the motor with it.
Could someone plz help me!
I have the following code (this is just one button for the gui and the other buttons have the same code:
% --- Executes on button press in Snelheid100_button.
function Snelheid100_button_Callback(hObject, eventdata, handles)
% hObject handle to Snelheid100_button (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA
a= arduino();
analogWrite(3,80);
clear a;
0 个评论
回答(1 个)
另请参阅
类别
在 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!