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 #include "cmsis_os.h" 00003 00004 DigitalOut led1(LED1); 00005 DigitalOut led2(LED2); 00006 Serial pc(USBTX , USBRX); 00007 00008 void led2_thread(void const *args){ 00009 while (true) { 00010 led2 = !led2; 00011 osDelay(1000); 00012 } 00013 } 00014 00015 void serial_thread(const void *args){ 00016 pc.baud(115200); 00017 while(true){ 00018 pc.putc(pc.getc()); 00019 } 00020 } 00021 00022 osThreadDef(serial_thread, osPriorityNormal, DEFAULT_STACK_SIZE); 00023 osThreadDef(led2_thread, osPriorityNormal, DEFAULT_STACK_SIZE); 00024 00025 int main() { 00026 osThreadCreate(osThread(led2_thread), NULL); 00027 osThreadCreate(osThread(serial_thread), NULL); 00028 while(true); 00029 }
Generated on Thu Jul 14 2022 09:01:30 by
1.7.2