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.
Dependencies: mbed mbed-rtos 4DGL-uLCD-SE
Diff: main.cpp
- Revision:
- 1:c27c61c0a1e0
- Parent:
- 0:2f5503566475
- Child:
- 5:568a15151d11
diff -r 2f5503566475 -r c27c61c0a1e0 main.cpp
--- a/main.cpp Fri Jul 13 11:36:50 2012 +0000
+++ b/main.cpp Fri Jul 13 11:39:26 2012 +0000
@@ -0,0 +1,24 @@
+#include "mbed.h"
+#include "rtos.h"
+
+DigitalOut LEDs[4] = {
+ DigitalOut(LED1), DigitalOut(LED2), DigitalOut(LED3), DigitalOut(LED4)
+};
+
+void blink(void const *n) {
+ LEDs[(int)n] = !LEDs[(int)n];
+}
+
+int main(void) {
+ RtosTimer led_1_timer(blink, osTimerPeriodic, (void *)0);
+ RtosTimer led_2_timer(blink, osTimerPeriodic, (void *)1);
+ RtosTimer led_3_timer(blink, osTimerPeriodic, (void *)2);
+ RtosTimer led_4_timer(blink, osTimerPeriodic, (void *)3);
+
+ led_1_timer.start(2000);
+ led_2_timer.start(1000);
+ led_3_timer.start(500);
+ led_4_timer.start(250);
+
+ Thread::wait(osWaitForever);
+}
