Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
main.cpp
00001 #include "mbed.h" 00002 00003 PwmOut motor1_pwm(D5); 00004 00005 int main(void) 00006 { 00007 const int frequency_pwm = 10000; //10kHz PWM frequency 00008 motor1_pwm.period( 1.0/frequency_pwm); //Period is 1 over frequency T=1/f 00009 while(true) 00010 for(int i=40 ; i<=100 ; i=i+10) 00011 { 00012 motor1_pwm.write(i/100.0); //Write Duty Cycle 00013 wait(10); 00014 } 00015 } 00016
Generated on Tue Jul 26 2022 22:18:01 by
