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.
Fork of mBuino_Dice by
Diff: main.cpp
- Revision:
- 0:5d9ccbe9d49d
- Child:
- 1:38fcbf88615a
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Wed Jul 23 19:02:43 2014 +0000
@@ -0,0 +1,33 @@
+#include "mbed.h"
+//#include "rtos.h"
+
+float delayTime = .05;
+
+DigitalOut LED[] = {(P0_7), (P0_8), (P0_2), (P0_20), (P1_19), (P0_17), (P0_23)};// declare 7 LEDs
+
+int main()
+{
+ int i = 0;
+ while( i < 10 ) {
+ for(int x = 0; x < 7; x++) {
+ LED[x] = 1; // turn on
+ wait(delayTime); // delay
+ }
+ for(int x = 0; x < 7; x++) {
+ LED[x] = 0; // turn off
+ wait(delayTime); // delay
+ }
+ for(int x = 6; x >= 0; x--) {
+ LED[x] = 1; // turn on
+ wait(delayTime); // delay
+ }
+ for(int x = 6; x >= 0; x--) {
+ LED[x] = 0; // turn off
+ wait(delayTime); // delay
+ }
+
+ i++;
+ }
+
+ //Thread::wait(osWaitForever);
+}
