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
Revision 0:4e85bd9d70d2, committed 2016-10-06
- Comitter:
- MechA042
- Date:
- Thu Oct 06 04:07:54 2016 +0000
- Commit message:
- motor_test
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 Thu Oct 06 04:07:54 2016 +0000
@@ -0,0 +1,28 @@
+#include "mbed.h"
+
+PwmOut mypwm(D3);
+
+
+int main() {
+
+ mypwm.period(0.01);
+ //mypwm.write(0.15);
+ //mypwm.pulsewidth(0.0015);
+
+ while(1){
+ mypwm.write(0.15);
+ printf("pwm set to %.2f %%\n", mypwm.read() * 100);
+ wait(1);
+ mypwm.write(0.18);
+ printf("pwm set to %.2f %%\n", mypwm.read() * 100);
+ wait(1);
+ mypwm.write(0.15);
+ printf("pwm set to %.2f %%\n", mypwm.read() * 100);
+ wait(1);
+ mypwm.write(0.12);
+ printf("pwm set to %.2f %%\n", mypwm.read() * 100);
+ wait(1);
+
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Oct 06 04:07:54 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/25aea2a3f4e3 \ No newline at end of file