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:a0ff9388a0b8
- Child:
- 1:13ed59a7806b
diff -r 000000000000 -r a0ff9388a0b8 main.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Thu Aug 26 16:51:51 2010 +0000
@@ -0,0 +1,22 @@
+#include "mbed.h"
+// Cylon style LED scanner
+BusOut led_state(LED1, LED2, LED3, LED4);
+
+int main() {
+ int i = 0;
+ // initinal LED state
+ led_state = 0x1;
+ while (1) {
+ // loop through all states
+ for (i=0; i<6; i++) {
+ if (i<3)
+ // shift left 1 bit until high LED set
+ led_state = led_state << 1;
+ else
+ // then reverse and shift back to right 1 bit
+ led_state = led_state >> 1;
+ // time delay .1s to slow down display
+ wait(0.1);
+ }
+ }
+}