![](/media/cache/profiles/JCSB.jpg.50x50_q85.jpg)
PWM with L298 for two DC Motors.
Dependencies: mbed FPointer TextLCD1 keypad
Fork of L298 by
Diff: main.cpp
- Revision:
- 2:2e93c305bb62
- Parent:
- 1:c83539e7f8a0
- Child:
- 3:5d21835b1f70
- Child:
- 4:72727d4c1d72
--- a/main.cpp Wed Jun 22 21:31:17 2016 +0000 +++ b/main.cpp Thu Jun 23 12:43:49 2016 +0000 @@ -1,5 +1,7 @@ #include "mbed.h" + +Serial pc(USBTX,USBRX); // tx,rx DigitalOut in1(PTC3); DigitalOut in2(PTC2); PwmOut ena(PTA2); @@ -8,9 +10,13 @@ DigitalOut in4(PTD2); PwmOut enb(PTD3); - +void rxInterrupt(){ +} int main() + { +pc.baud(115200); +pc.attach(&rxInterrupt); while (true) { /////******MOTOR 1****//// // Detiene el motor @@ -29,7 +35,7 @@ wait(0.5f); /////******MOTOR 2****//// - in3 = 0; + /* in3 = 0; in4 = 0; wait(0.5f); // Gira en sentido 1 con velocidad 50% @@ -41,6 +47,8 @@ in3 = 0; in4 = 1; ena.write(1.00f); - wait(0.5f); + wait(0.5f);*/ + pc.printf("MOTOR Funcionando\n"); + } } \ No newline at end of file