Chris Styles
/
mbedISP
Embed:
(wiki syntax)
Show/hide line numbers
main.cpp
00001 #include "mbed.h" 00002 00003 DigitalOut led1(LED1); 00004 DigitalOut led2(LED2); 00005 00006 Serial pc (USBTX,USBRX); 00007 Serial target (p28,p27); 00008 00009 int main() { 00010 00011 pc.baud(115200); 00012 target.baud(115200); 00013 00014 while (1) { 00015 00016 if (pc.readable()) { 00017 target.putc(pc.getc()); 00018 led1 = !led1; 00019 } 00020 00021 if (target.readable()) { 00022 pc.putc(target.getc()); 00023 led2 = !led2; 00024 } 00025 } 00026 } 00027
Generated on Tue Jul 19 2022 05:48:07 by 1.7.2