Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of L298 by
Revision 2:2e93c305bb62, committed 2016-06-23
- Comitter:
- juanitoinig84
- Date:
- Thu Jun 23 12:43:49 2016 +0000
- Parent:
- 1:c83539e7f8a0
- Commit message:
- PWM wirh L298 for 2 DC motors
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- 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
