H BRIDGE PARA MOTORES DC KL64Z

Dependencies:   Motor mbed Servo

Files at this revision

API Documentation at this revision

Comitter:
mderrant
Date:
Wed Jul 30 22:13:54 2014 +0000
Parent:
2:d10dff926d9a
Commit message:
MOTOR DC

Changed in this revision

Servo.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Servo.lib	Wed Jul 30 22:13:54 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mderrant/code/Servo/#aef90cd5d8b6
--- a/main.cpp	Mon Jul 28 23:17:54 2014 +0000
+++ b/main.cpp	Wed Jul 30 22:13:54 2014 +0000
@@ -1,17 +1,20 @@
 #include "mbed.h"
 #include "Motor.h"
+#include "Servo.h"
+
+
+Servo s1(PTA13);
 
 Motor motor1(PTA1, PTA2, PTD3); // pwm, fwd, rev
 Motor motor2(PTA12,PTA4,PTA5);
 
 AnalogIn sensorizq(PTB0);
 AnalogIn sensorder(PTB2);
-AnalogIn sensorcentro(PTB1);
 
 PwmOut  anout(LED_RED),anout2(LED_GREEN);
  
 
-float valorizq,valorder,valorcentro;
+float valorizq,valorder;
 
 int main()
  {
@@ -31,14 +34,17 @@
  */
      valorder = 1.0-sensorder;
      valorizq = 1.0-sensorizq;
-     valorcentro = 1.0-sensorcentro;
              
     motor1.speed(valorizq/10);
     motor2.speed(valorder/10);
+    
+    s1 = sensorizq.read();
 
 
     anout = valorizq/200;
     anout2 = valorder/200;
+    
+    
  //   wait(3.0);
  //   printf("%u \r",sensorizq.read_u16());