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 Thread thread; 00004 DigitalOut led1(LED1); 00005 volatile bool running = true; 00006 00007 // Blink function toggles the led in a long running loop 00008 void blink(DigitalOut *led) { 00009 while (running) { 00010 *led = !*led; 00011 wait(1); 00012 } 00013 } 00014 00015 // Spawns a thread to run blink for 5 seconds 00016 int main() { 00017 thread.start(callback(blink, &led1)); 00018 wait(5); 00019 running = false; 00020 thread.join(); 00021 }
Generated on Sat Aug 20 2022 15:27:17 by
1.7.2