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
Revision 3:f652c4b6b709, committed 2015-02-08
- Comitter:
- jaredwil
- Date:
- Sun Feb 08 23:23:30 2015 +0000
- Parent:
- 2:bfe32024e001
- Commit message:
- new commented;
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Sun Feb 08 15:13:09 2015 +0000
+++ b/main.cpp Sun Feb 08 23:23:30 2015 +0000
@@ -8,6 +8,7 @@
DigitalOut myled1(LED1);
DigitalOut myled2(LED2);
DigitalOut myled3(LED3);
+DigitalOut myled4(LED4);
Timer timer;
@@ -15,17 +16,17 @@
//Initialze randomness
srand(time(NULL));
- //Define the random sequence of leds length 10 (Either 0, 1, or 2)
- int a = (rand()%3);
- int b = (rand()%3);
- int c = (rand()%3);
- int d = (rand()%3);
- int e = (rand()%3);
- int f = (rand()%3);
- int g = (rand()%3);
- int h = (rand()%3);
- int i = (rand()%3);
- int j = (rand()%3);
+ //Define the random sequence of leds length 10 (Either 0, 1, 2, 3)
+ int a = (rand()%4);
+ int b = (rand()%4);
+ int c = (rand()%4);
+ int d = (rand()%4);
+ int e = (rand()%4);
+ int f = (rand()%4);
+ int g = (rand()%4);
+ int h = (rand()%4);
+ int i = (rand()%4);
+ int j = (rand()%4);
int pattern[10] = {a,b,c,d,e,f,g,h,i,j};
//Debug purposes
@@ -55,6 +56,11 @@
wait(1.8);
myled3 = 0;
break;
+ case 3:
+ myled4 = 1;
+ wait(1.8);
+ myled4 = 0;
+ break;
}
}
}