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 00003 DigitalOut led1(LED1); 00004 DigitalOut led2(LED2); 00005 00006 UARTSerial pc(USBTX, USBRX); 00007 00008 void callback_ex() { 00009 while (1) { 00010 char c; 00011 if (pc.read(&c, 1) != 1) { 00012 break; 00013 } 00014 printf("%c\n", c); 00015 led2 = !led2; 00016 } 00017 } 00018 00019 int main() { 00020 pc.set_blocking(false); 00021 pc.sigio(mbed::mbed_event_queue()->event(callback_ex)); 00022 00023 while (1) { 00024 led1 = !led1; 00025 wait(0.5); 00026 } 00027 } 00028
Generated on Wed Jul 13 2022 20:32:00 by
1.7.2