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.
Diff: main.cpp
- Revision:
- 0:1e686880e49e
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Mon Sep 27 01:59:32 2010 +0000
@@ -0,0 +1,39 @@
+#include "mbed.h"
+#include "stdlib.h"
+#define WAIT_TIME .02
+#define w() wait(WAIT_TIME)
+DigitalOut myled1(LED1);
+DigitalOut myled2(LED2);
+DigitalOut myled3(LED3);
+DigitalOut myled4(LED4);
+int number;
+void blink(DigitalOut led) {
+ led = 1;
+ w();
+ led = 0;
+ w();
+ }
+
+int main() {
+ while(1) {
+ number = rand();
+ if ((number % 4) == 0)
+ {
+ blink(myled1);
+ }
+ else if ((number % 4) == 1)
+ {
+ blink(myled2);
+ }
+ else if ((number % 4) == 2)
+ {
+ blink(myled3);
+ }
+ else
+ {
+ blink(myled4);
+ }
+
+
+ }
+}