1 sola salida de PWM del KL25Z para el Enable del puente H. 1 solo botón conectado a un NOT. La negación va al IN1 y la no negada va al IN2. Para que con un solo botón haya un control del giro del motor pero sin freno.

Dependencies:   mbed

Revision:
0:657fc6ce0791
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/motordc3.cpp	Tue Dec 01 04:16:40 2015 +0000
@@ -0,0 +1,34 @@
+#include "mbed.h"
+AnalogIn pot(PTB3);
+PwmOut motordc(PTD4);
+DigitalIn boton(PTB2);
+DigitalOut IN1(PTD0);
+DigitalOut IN2(PTD5);
+DigitalOut myled(LED1);
+
+int main() {
+    
+    myled=0;
+    wait(0.5);
+    myled=1;
+
+        
+    while(1) {
+        
+        
+        if(boton==1){
+            float input = pot; 
+            motordc = input; 
+            IN1=1;
+            IN2=0;
+            wait(0.1);
+        } else if(boton==0){
+            float input = pot; 
+            motordc = input; 
+            IN1=0;
+            IN2=1;
+            wait(0.1);
+                
+                }
+    }
+}
\ No newline at end of file