Now all faces can win (not ones always win) and wait sequence reduced

Dependencies:   PixelArray mbed

Fork of blip_dado by Alberto Piganti

Files at this revision

API Documentation at this revision

Comitter:
JCristobal
Date:
Fri Dec 04 10:07:24 2015 +0000
Parent:
4:55d1628dd2e5
Commit message:
Now all faces can win (not ones always win) and wait sequence reduced

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 55d1628dd2e5 -r 3c7292459503 main.cpp
--- a/main.cpp	Tue Dec 01 14:26:03 2015 +0000
+++ b/main.cpp	Fri Dec 04 10:07:24 2015 +0000
@@ -1,4 +1,6 @@
-// miniblip led dado demo
+// miniblip led dado 
+// JCristobal version, original Alberto Pigante from https://developer.mbed.org/users/pighixxx/code/blip_dado/
+// Now all faces can win (not ones always win) and wait sequence reduced
 
 #include "mbed.h"
 #include "neopixel.h"
@@ -133,8 +135,9 @@
             posLed=0;
             float pot = ain.read() * 100.0f;
             int startdelay=10;
-            int face=1;
-            int red=10;
+            int face=1;             // ones always win
+            face = rand() % 6 + 1;  // Let's give a chance to others
+            int red=50;
             while (1) {
                 if (startdelay>300+(pot*3)) red=200;
                 switch(face) {
@@ -160,8 +163,7 @@
                 array.update(vector, 64);
                 if (startdelay>300+(pot*3)) break;
                 face++;
-                startdelay=startdelay+10;
-                
+                startdelay=startdelay+50;
                 if (face>6) face=1;
                 wait_ms(startdelay);