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 LED[3] = { 00005 DigitalOut(LED1), 00006 DigitalOut(LED2), 00007 DigitalOut(LED3) 00008 }; 00009 00010 void blink(void const *n) { 00011 LED[(int)n] = !LED[(int)n]; 00012 } 00013 00014 int main() { 00015 RtosTimer led_1_timer(blink, osTimerPeriodic, (void *)0); 00016 RtosTimer led_2_timer(blink, osTimerPeriodic, (void *)1); 00017 RtosTimer led_3_timer(blink, osTimerPeriodic, (void *)2); 00018 00019 led_1_timer.start(2000); 00020 led_2_timer.start(1000); 00021 led_3_timer.start(500); 00022 Thread::wait(osWaitForever); 00023 }
Generated on Wed Jul 27 2022 03:36:00 by
1.7.2