Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp
00001 #include "mbed.h" 00002 //BlHeli Cable (mbed FTDI) see manual for 1-pin hookup - needs resistor? and diode! 00003 //worked without resistor on my setup 00004 //See https://developer.mbed.org/users/4180_1/notebook/using-a-dc-brushless-motor-with-an-rc-esc/ 00005 RawSerial pc(USBTX, USBRX); 00006 RawSerial dev(p9, p10); 00007 DigitalOut led1(LED1); 00008 DigitalOut led4(LED4); 00009 00010 void dev_recv() 00011 { 00012 led1 = !led1; 00013 while(dev.readable()) { 00014 pc.putc(dev.getc()); 00015 } 00016 } 00017 00018 void pc_recv() 00019 { 00020 led4 = !led4; 00021 while(pc.readable()) { 00022 dev.putc(pc.getc()); 00023 } 00024 } 00025 00026 int main() 00027 { 00028 pc.baud(19200); 00029 dev.baud(19200); 00030 00031 pc.attach(&pc_recv, Serial::RxIrq); 00032 dev.attach(&dev_recv, Serial::RxIrq); 00033 00034 while(1) { 00035 sleep(); 00036 } 00037 }
Generated on Sun Jul 17 2022 05:37:34 by
1.7.2