moter

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
Nike3221
Date:
Tue May 31 13:14:15 2016 +0000
Commit message:
moter

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
diff -r 000000000000 -r e0341ee3f039 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue May 31 13:14:15 2016 +0000
@@ -0,0 +1,26 @@
+#include "mbed.h"
+
+Serial pc(USBTX, USBRX);
+DigitalOut myled(LED1);
+DigitalIn in1(p5);
+DigitalOut out1(p6);
+PwmOut moter(p21);
+
+int main() 
+{
+    float i;
+    while(1) {
+              i=0.0;
+              /*out1=0;
+              if(in1==1)
+               {*/
+                while(i<=0.8)
+                  {moter.period(0.02);
+                   moter.pulsewidth(i);
+                   i=i+0.005;
+                   pc.printf("%f\n",i);
+                   wait(0.3);}
+               //}
+        
+             }
+}
diff -r 000000000000 -r e0341ee3f039 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue May 31 13:14:15 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/082adc85693f
\ No newline at end of file