NXP
/
FTF2014_lab5
Lab 5 - mbed RTOS
Fork of FTF2014_lab5 by
Embed:
(wiki syntax)
Show/hide line numbers
main.cpp
00001 #include "mbed.h" 00002 #include "rtos.h" 00003 00004 DigitalOut led1(LED1); 00005 00006 void led2_thread(void const *argument) 00007 { 00008 while (true) { 00009 Thread::wait(2000); 00010 printf("Thread 2 \n"); 00011 fflush(stdout); 00012 } 00013 } 00014 00015 int main() 00016 { 00017 Thread thread(led2_thread); 00018 00019 while (true) { 00020 led1 = !led1; 00021 Thread::wait(1000); 00022 printf("Thread 1 \n"); 00023 fflush(stdout); 00024 } 00025 }
Generated on Wed Jul 13 2022 19:02:53 by 1.7.2