![](/media/cache/profiles/e5522f7ac7cd76f19b396595c9c25b40.50x50_q85.jpg)
Interface class for the Max Botix ultrasonic range finder model 1210. It includes input methods for PWM, Analog, and Serial. A PwmIn class was created to allow the PWM input to be read. Now includes automatic range update via interrupts.
Diff: PwmIn/PwmIn.cpp
- Revision:
- 3:05183e50a923
- Parent:
- 2:997b4057c879
--- a/PwmIn/PwmIn.cpp Mon Aug 23 07:11:10 2010 +0000 +++ b/PwmIn/PwmIn.cpp Thu Aug 26 18:25:19 2010 +0000 @@ -7,9 +7,10 @@ PwmIn::PwmIn(PinName pwi) : InterruptIn(pwi), PeriodMeasurement(0), PulseWidthMeasurement(1) { - rise(this, &PwmIn::PulseStart); - fall(this, &PwmIn::PulseStop); - start(); + mode(PullDown); + rise(this, &PwmIn::PulseStart); + fall(this, &PwmIn::PulseStop); + start(); } float PwmIn::read()