init
Diff: throttle.cpp
- Revision:
- 0:f9937e19c867
- Child:
- 1:0c3383524c95
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/throttle.cpp Wed May 20 11:43:43 2015 +0000 @@ -0,0 +1,11 @@ +#include "throttle.h" + +ThrottleCtrl::ThrottleCtrl(PinName servo): _servo(servo) { + MaxPos=2269; //Dette er det område vi har i første omgang + MinPos=695; +} + + +void ThrottleCtrl::set(float pos){ + _servo.pulsewidth_us(MinPos+pos*(MaxPos-MinPos)); +} \ No newline at end of file