robot

Dependencies:   FastPWM3 mbed

Revision:
19:a6cf15f89f3d
Parent:
18:3863ca45cf26
Child:
75:591556ce033d
--- a/PwmIn/PwmIn.cpp	Mon Oct 31 06:53:28 2016 +0000
+++ b/PwmIn/PwmIn.cpp	Wed Nov 02 12:52:00 2016 +0000
@@ -1,17 +1,6 @@
+#include "mbed.h"
 #include "PwmIn.h"
-#include "mbed.h"
-
-float map(float x, float in_min, float in_max, float out_min, float out_max)
-{
-    return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
-}
-
-float constrain(float in, float min, float max)
-{
-    if(in > max) return max;
-    if(in < min) return min;
-    return in;
-}
+#include "MathHelpers.h"
 
 PwmIn::PwmIn(PinName pin, int usec_min, int usec_max)
 {