Jared DiCarlo
/
foc-ed_in_the_bot_compact
working version
Fork of foc-ed_in_the_bot_compact by
Embed:
(wiki syntax)
Show/hide line numbers
pwm_in.h
00001 #ifndef _pwm_in 00002 #define _pwm_in 00003 #include "mbed.h" 00004 00005 class PWM_IN 00006 { 00007 public: 00008 PWM_IN(PinName pin, int usec_min, int usec_max); 00009 bool get_enabled(); 00010 float get_throttle(); 00011 00012 00013 private: 00014 InterruptIn* int_in; 00015 DigitalIn* dig_in; 00016 Timer timer; 00017 bool was_on; 00018 bool enabled; 00019 void handle_rise(); 00020 void handle_fall(); 00021 int usecs; 00022 int usec_min, usec_max; 00023 00024 }; 00025 #endif
Generated on Fri Jul 15 2022 19:19:55 by 1.7.2