moter
Dependencies: mbed
Diff: main.cpp
- Revision:
- 0:e0341ee3f039
--- /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);} + //} + + } +}