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 00004 DigitalOut led1(LED1); 00005 DigitalOut led2(LED2); 00006 //volatile bool running = true; 00007 00008 // Blink function toggles the led in a long running loop 00009 void blink(DigitalOut *led) { 00010 *led = 1; 00011 wait(1); 00012 *led = 0; 00013 return; 00014 } 00015 00016 // Spawns a thread to run blink for 5 seconds 00017 int main() { 00018 while(true){ 00019 Thread thread1; 00020 Thread thread2; 00021 thread1.start(callback(blink, &led1)); 00022 thread1.join(); 00023 thread2.start(callback(blink, &led2)); 00024 thread2.join(); 00025 } 00026 }
Generated on Thu Jul 14 2022 16:33:00 by
1.7.2