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 blip_dado by
Revision 5:3c7292459503, committed 2015-12-04
- 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 |
--- 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);
