Yoji KURODA / Mbed 2 deprecated Mechatro_MotorControl

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
ykuroda
Date:
Thu Oct 05 07:50:42 2017 +0000
Commit message:
1st commit;

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 05 07:50:42 2017 +0000
@@ -0,0 +1,23 @@
+// Motor Control ... Mechatronics example program
+//
+// 2017.10.05 ... Y.Kuroda
+//
+#include "mbed.h"
+
+PwmOut      a1(D1);
+DigitalOut  a2(D12);
+
+int main() {
+
+    a1.period_ms(1);
+
+    while(1) {
+        a1 = 0.1;   // duty is 10%
+        a2 = 0;
+        wait(3);    // 3 s
+
+        a1 = 0.9;   // duty is 10%!!!
+        a2 = 1;
+        wait(3);    // 3 sec
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Oct 05 07:50:42 2017 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/235179ab3f27
\ No newline at end of file