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 "rtos.h" 00003 00004 DigitalOut LEDs[4] = {DigitalOut(D13), DigitalOut(D12), DigitalOut(D11), DigitalOut(D10)}; 00005 00006 void blink(void const *n) { 00007 LEDs[(int)n] = !LEDs[(int)n]; 00008 } 00009 00010 int main(void) { 00011 RtosTimer led_1_timer(blink, osTimerPeriodic, (void *)0); 00012 RtosTimer led_2_timer(blink, osTimerPeriodic, (void *)1); 00013 RtosTimer led_3_timer(blink, osTimerPeriodic, (void *)2); 00014 RtosTimer led_4_timer(blink, osTimerPeriodic, (void *)3); 00015 00016 led_1_timer.start(2000); 00017 led_2_timer.start(1000); 00018 led_3_timer.start(500); 00019 led_4_timer.start(250); 00020 00021 Thread::wait(osWaitForever); 00022 }
Generated on Wed Jul 13 2022 20:23:51 by
1.7.2