robot

Dependencies:   FastPWM3 mbed

Revision:
78:b8df106126a7
Parent:
75:591556ce033d
Child:
92:a9dac72d8cac
--- a/PwmIn/PwmIn.cpp	Fri Feb 24 21:38:03 2017 +0000
+++ b/PwmIn/PwmIn.cpp	Sat Feb 25 01:12:27 2017 +0000
@@ -2,7 +2,7 @@
 #include "PwmIn.h"
 #include "MathHelpers.h"
 
-PwmIn::PwmIn(PinName pin, int usec_min, int usec_max)
+PwmIn::PwmIn(PinName pin, int usec_min, int usec_max, int usec_crazy)
 {
     int_in = new InterruptIn(pin);
     dig_in = new DigitalIn(pin);
@@ -10,6 +10,7 @@
     int_in->fall(this, &PwmIn::handle_fall);
     this->usec_min = usec_min;
     this->usec_max = usec_max;
+    this->usec_crazy = usec_crazy;
     
     usecs = usec_min;
     blocked = false;
@@ -43,7 +44,7 @@
         return;
     }
     
-    if (usecs_new <= usec_max) usecs = usecs_new;
+    if (usecs_new <= usec_crazy) usecs = usecs_new;
 }
 
 float PwmIn::get_throttle()