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.
main.cpp
00001 /*Program Example 5.2: Uses analog input to control PWM duty cycle, fixed period 00002 */ 00003 #include "mbed.h" 00004 PwmOut PWM1(p21); 00005 AnalogIn Ain(p20); //defines analog input on Pin 20 00006 00007 int main() { 00008 while(1){ 00009 PWM1.period(0.010); // set PWM period to 10 ms 00010 PWM1=Ain; //Analog in value becomes PWM duty, both are type float 00011 wait(0.1); 00012 } 00013 } 00014
Generated on Sun Oct 30 2022 01:51:20 by
1.7.2