control de motores
Dependencies: mbed
Revision 0:ca642abf6036, committed 2015-05-16
- Comitter:
- fonz626
- Date:
- Sat May 16 21:35:52 2015 +0000
- Commit message:
- hwo to control pwm
Changed in this revision
cdm.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 ca642abf6036 cdm.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cdm.cpp Sat May 16 21:35:52 2015 +0000 @@ -0,0 +1,23 @@ +#include "mbed.h" +PwmOut PWMa1(PTC3); +PwmOut PWMa2(PTC4); +PwmOut PWMb1(PTC1); +PwmOut PWMb2(PTC2); +DigitalOut menable(PTE21); + +int main() { +PWMa1.period(0.05); // set PWM period to 10 ms +PWMa2.period(0.05); +PWMb1.period(0.05); +PWMb2.period(0.05); + +while(true){ +PWMa1.write(0.01); +PWMa2.write(0.0); +PWMb1.write(0.1); +PWMb2.write(0.0); +//wait(1); +menable=1; + +} +} \ No newline at end of file
diff -r 000000000000 -r ca642abf6036 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sat May 16 21:35:52 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/dbbf35b96557 \ No newline at end of file