Bayley Wang
/
foc-ed_in_the_bot_compact
robot
Diff: PwmIn/PwmIn.h
- Revision:
- 75:591556ce033d
- Parent:
- 18:3863ca45cf26
- Child:
- 78:b8df106126a7
--- a/PwmIn/PwmIn.h Fri Feb 24 13:03:34 2017 +0000 +++ b/PwmIn/PwmIn.h Fri Feb 24 21:37:14 2017 +0000 @@ -8,16 +8,21 @@ PwmIn(PinName pin, int usec_min, int usec_max); bool get_enabled(); float get_throttle(); +public: + void block() {blocked = true;} + int state() {return dig_in->read();} + int get_usecs() {return usecs;} +private: + void handle_rise(); + void handle_fall(); private: InterruptIn* int_in; DigitalIn* dig_in; Timer timer; - bool was_on; + int usec_min, usec_max; +private: bool enabled; - void handle_rise(); - void handle_fall(); + bool blocked; int usecs; - int usec_min, usec_max; - }; #endif \ No newline at end of file