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