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.
Revision 0:102eab0a783a, committed 2015-02-15
- Comitter:
- neutron_striker
- Date:
- Sun Feb 15 19:32:08 2015 +0000
- Commit message:
- My Pwm program with method number 1
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
| mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Sun Feb 15 19:32:08 2015 +0000
@@ -0,0 +1,23 @@
+#include "mbed.h"
+
+PwmOut mypwm(LED1);
+
+//DigitalOut myled(LED1);
+
+int main() {
+
+ mypwm.period_ms(10);
+ mypwm.pulsewidth_ms(1);
+
+ printf("pwm set to %.2f %%\n", mypwm.read() * 100);
+
+ while(1) {
+ for(uint8_t i=0;i<10;i++)
+ {
+ mypwm.pulsewidth_ms(i);
+ wait(0.03);
+ }
+ // myled = !myled;
+ // wait(1);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sun Feb 15 19:32:08 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/e188a91d3eaa \ No newline at end of file