Jared DiCarlo
/
foc-ed_in_the_bot_compact
working version
Fork of foc-ed_in_the_bot_compact by
Diff: pwm_in.h
- Revision:
- 13:41d102a53caf
diff -r 5723a4fa5864 -r 41d102a53caf pwm_in.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pwm_in.h Sun Oct 30 02:06:03 2016 +0000 @@ -0,0 +1,25 @@ +#ifndef _pwm_in +#define _pwm_in +#include "mbed.h" + +class PWM_IN +{ + public: + PWM_IN(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