robot

Dependencies:   FastPWM3 mbed

Revision:
18:3863ca45cf26
Parent:
16:f283d6032fe5
Child:
75:591556ce033d
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PwmIn/PwmIn.h	Mon Oct 31 06:53:28 2016 +0000
@@ -0,0 +1,23 @@
+#ifndef __PWMIN_H
+#define __PWMIN_H
+
+#include "mbed.h"
+
+class PwmIn {
+public:
+    PwmIn(PinName pin, int usec_min, int usec_max);
+    bool get_enabled();
+    float get_throttle();
+private:
+    InterruptIn* int_in;
+    DigitalIn*   dig_in;
+    Timer timer;
+    bool was_on;
+    bool enabled;
+    void handle_rise();
+    void handle_fall();
+    int usecs;
+    int usec_min, usec_max;
+    
+};
+#endif
\ No newline at end of file