Una sola salida PWM del KL25Z para el Enable del puente H. Enable ya no esta conectado a 5 v logicos. Los In (entradas del puente H) son controlados por medio de botones físicos.
Revision 0:1d1de6d43fea, committed 2015-12-01
- Comitter:
- alonsoangulo
- Date:
- Tue Dec 01 04:12:22 2015 +0000
- Commit message:
- Controlador motor DC segunda forma
Changed in this revision
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
motordc2.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 000000000000 -r 1d1de6d43fea mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Tue Dec 01 04:12:22 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/9327015d4013 \ No newline at end of file
diff -r 000000000000 -r 1d1de6d43fea motordc2.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/motordc2.cpp Tue Dec 01 04:12:22 2015 +0000 @@ -0,0 +1,19 @@ +#include "mbed.h" +AnalogIn pot(PTB3); +PwmOut motordc(PTD4); +DigitalOut myled(LED1); + +int main() { + + myled=0; + wait(0.5); + myled=1; + + + while(1) { + float input = pot; + motordc = input; + wait(0.1); + } + +}