Used to tune ESC controllers using BLHeli firmware
See https://os.mbed.com/users/4180_1/notebook/using-a-dc-brushless-motor-with-an-rc-esc/ fpr details.
Revision 0:58c5e839229e, committed 2017-05-20
- Comitter:
- 4180_1
- Date:
- Sat May 20 01:04:12 2017 +0000
- Commit message:
- ver 1.0
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
diff -r 000000000000 -r 58c5e839229e main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sat May 20 01:04:12 2017 +0000 @@ -0,0 +1,37 @@ +#include "mbed.h" +//BlHeli Cable (mbed FTDI) see manual for 1-pin hookup - needs resistor? and diode! +//worked without resistor on my setup +//See https://developer.mbed.org/users/4180_1/notebook/using-a-dc-brushless-motor-with-an-rc-esc/ +RawSerial pc(USBTX, USBRX); +RawSerial dev(p9, p10); +DigitalOut led1(LED1); +DigitalOut led4(LED4); + +void dev_recv() +{ + led1 = !led1; + while(dev.readable()) { + pc.putc(dev.getc()); + } +} + +void pc_recv() +{ + led4 = !led4; + while(pc.readable()) { + dev.putc(pc.getc()); + } +} + +int main() +{ + pc.baud(19200); + dev.baud(19200); + + pc.attach(&pc_recv, Serial::RxIrq); + dev.attach(&dev_recv, Serial::RxIrq); + + while(1) { + sleep(); + } +} \ No newline at end of file
diff -r 000000000000 -r 58c5e839229e mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sat May 20 01:04:12 2017 +0000 @@ -0,0 +1,1 @@ +https://mbed.org/users/mbed_official/code/mbed/builds/4eea097334d6 \ No newline at end of file