Ejemplo de funcionamiento de una tarjeta mbed con un puente H L298

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
satelite
Date:
Mon Jun 20 05:18:43 2016 +0000
Commit message:
Ejemplo L298

Changed in this revision

main.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 f3cd2e9ab89b main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Jun 20 05:18:43 2016 +0000
@@ -0,0 +1,25 @@
+#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);
+    }
+}
\ No newline at end of file
diff -r 000000000000 -r f3cd2e9ab89b mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Jun 20 05:18:43 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/6c34061e7c34
\ No newline at end of file