![](/media/cache/profiles/JCSB.jpg.50x50_q85.jpg)
PWM with L298 for two DC Motors.
Dependencies: mbed FPointer TextLCD1 keypad
Fork of L298 by
main.cpp
- Committer:
- satelite
- Date:
- 2016-06-20
- Revision:
- 0:f3cd2e9ab89b
- Child:
- 1:c83539e7f8a0
File content as of revision 0:f3cd2e9ab89b:
#include "mbed.h" DigitalOut in1(PTC3); DigitalOut in2(PTC2); PwmOut ena(PTA2); int main() { while (true) { // Detiene el motor in1 = 0; in2 = 0; wait(0.5f); // Gira en sentido 1 con velocidad 50% in1 = 1; in2 = 0; ena.write(0.50f); wait(0.5f); // Gira en sentido 2 con velocidad 100% in1 = 0; in2 = 1; ena.write(1.00f); wait(0.5f); } }