Dependencies: mbed
Diff: main.cpp
- Revision:
- 3:f652c4b6b709
- Parent:
- 2:bfe32024e001
--- 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; } } }