Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
pwm_in.h
- Committer:
- dicarloj
- Date:
- 2016-11-06
- Revision:
- 7:ed19a937daa0
- Parent:
- 2:7312ac02785d
File content as of revision 7:ed19a937daa0:
#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