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 // mbed-shiny 00002 #include "mbed.h" 00003 #include "SoftPdmOut.h" 00004 00005 SoftPdmOut pdm(LED1); 00006 00007 int main() 00008 { 00009 float pdmSet = 0.0f; 00010 float pdmAdd = 0.01f; 00011 00012 // Continuously cycle the output 00013 while(1) 00014 { 00015 pdm = pdmSet; 00016 wait_ms(10); 00017 if(pdmSet >= 1.0f) 00018 pdmAdd = -0.01f; 00019 if(pdmSet <= 0.0f) 00020 pdmAdd = 0.01f; 00021 pdmSet += pdmAdd; 00022 } 00023 }
Generated on Mon Jul 18 2022 02:47:23 by
1.7.2