![](/media/cache/profiles/916954106a13204fa4909ae2d48e0602.jpg.50x50_q85.jpg)
motor controller
pwm_in.h
- Committer:
- dicarloj
- Date:
- 2016-10-30
- Revision:
- 2:7312ac02785d
File content as of revision 2:7312ac02785d:
#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