Wrapper library for ESC PWM throttle control.
Fork of ESC by
Diff: esc.cpp
- Revision:
- 2:b2d19bc95805
- Parent:
- 1:4c02fede684b
diff -r 4c02fede684b -r b2d19bc95805 esc.cpp --- a/esc.cpp Sun Jun 09 22:23:45 2013 +0000 +++ b/esc.cpp Fri May 05 14:10:46 2017 +0000 @@ -1,8 +1,8 @@ #include "mbed.h" #include "esc.h" -ESC::ESC(PwmOut pwmPinOut, int period) - : esc(pwmPinOut), period(period), throttle(1000) { +ESC::ESC(PwmOut pwmPinOut, int period, int throttle) + : esc(pwmPinOut), period(period), throttle(throttle) { esc.period_ms(period); esc.pulsewidth_us(throttle); } @@ -19,3 +19,7 @@ void ESC::pulse(void) { esc.pulsewidth_us(throttle); } + +void ESC::failsafe(void) { + esc.pulsewidth_us(0); +}