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: EthernetInterface mbed-rtos mbed
Diff: main.cpp
- Revision:
- 3:1e86c29d1eac
- Parent:
- 2:d62b28f02d45
- Child:
- 4:f2789e665f4e
diff -r d62b28f02d45 -r 1e86c29d1eac main.cpp
--- a/main.cpp Sun May 04 02:49:24 2014 +0000
+++ b/main.cpp Sun May 04 03:05:22 2014 +0000
@@ -2,22 +2,22 @@
#include "Thread.h"
#include "mbed.h"
-void ledThreadProc(const void *param)
-{
- DigitalOut led2(LED2);
+DigitalOut led2(LED2, 1);
- for (;;)
- {
- led2 = !led2;
- Thread::wait(500);
- }
+// Blink function
+void blink(const void *param)
+{
+ led2 = !led2;
}
-
int main(void)
{
// Create a digital output on LED1
- DigitalOut led1(LED1);
+ DigitalOut led1(LED1, 1);
+
+ // Start the blink timer at 1 second interval
+ RtosTimer timer(blink);
+ timer.start(1000);
// Construct the Ethernet interface
EthernetInterface eth;