KRAI 2017
/
ESC_test
esc test kontrol atas
Diff: main.cpp
- Revision:
- 0:7388487b63fb
- Child:
- 1:8b6c35986de0
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sun Sep 25 05:58:05 2016 +0000 @@ -0,0 +1,24 @@ +#include "mbed.h" +#include "esc.h" + +ESC edf(PC_6,20); +Serial pc(USBTX,USBRX); + +float max = 0.5; + +float pwm; + +int main() { + + pc.baud(9600); + edf.setThrottle(pwm); + edf.pulse(); + + while(1) { + for (pwm = 0; pwm <max; pwm+=0.01){ + edf.setThrottle(pwm); + edf.pulse(); + wait_ms(70); + } + } +}