How to change pulse width modulation FREQUENCY of arduino analog pins with new support package for R2014b?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I need to change the pulse-width modulation FREQUENCY (not the duty cycle) of the arduino analog pins for my applications. With the previous arduinoio package for matlab ( http://www.mathworks.com/matlabcentral/fileexchange/32374-matlab-support-for-arduino--aka-arduinoio-package-), one had to upload the sketch to the arduino manually, but the advantage was that this enabled the user to add some lines to the setup() function in the sketch that would change the PWM frequency of the pins.
The R2014b matlab support package for arduino (<http://www.mathworks.com/matlabcentral/fileexchange/47522-matlab-support-package-for-arduino%C2%AE-hardware>) replaces the existing sketch on the arduino by an auto-generated one upon executing the command arduino(port) and I have no control over what's actually being uploaded to the arduino.
Can anyone tell me, how to change the PWM frequencies with new package?
Thanks so much! Wolfgang
1 commentaire
Martin Egginton
le 24 Déc 2015
Did you ever solve this problem? I think it's a common requirement.
Am using 2015a
Thanks Martin
Réponses (3)
Martin Egginton
le 25 Déc 2015
You can add a S-function builder block on the sketch to include custom code to be run either in setup() or loop().
I think you should then be able to use the code you used in the previous package.
Best Regards, Martin
0 commentaires
Ahmet yüksel
le 28 Nov 2016
ı want to change arduino pwm freqaucny in MATLAB SIMULINK, how to do this, thank you a lot..
1 commentaire
pallab choudhury
le 13 Juin 2018
@ Ahmet yüksel ...did you find the solution?..I am also facing same issue to set PWM frequency for MATLAB support package of Arduino..I am using 2017b...could you please share for MATLAB model (Not Simulink)?..Thanks
HARIS
le 23 Nov 2014
Dear Wolfgang can you tell me how to change the pwm frequency in the previous support package you are talking about, as i need it very urgent for my project and i tried a lot to change it with the previous package but couldnt succeed. can you send me one example. Thanks alot
Voir également
Catégories
En savoir plus sur Arduino Hardware dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!