moter
Dependencies: mbed
main.cpp
- Committer:
- Nike3221
- Date:
- 2016-05-31
- Revision:
- 0:e0341ee3f039
File content as of revision 0:e0341ee3f039:
#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);} //} } }