The Lottery toy that used in LASS(http://lass-net.org/) Users and Developers conference 2016

Dependencies:   C12832 mbed

Revision:
3:357d242c2ee7
Parent:
2:254e72dcfb52
--- a/main.cpp	Wed Jul 20 11:59:33 2016 +0000
+++ b/main.cpp	Wed Jul 20 20:44:56 2016 +0800
@@ -13,7 +13,7 @@
 BusOut leds(LED1,LED2,LED3,LED4);
 AnalogIn RandomIn(p17); // use the random noise on this analog input to seed the random generator
 #define GIFT_MAXCNT 24 // Max gift count 
-#define MAN_MAXCNT 120 // How many users 
+#define MAN_MAXCNT 122 // How many users 
 
 
 void SetLed(uint8_t ledID, bool on)
@@ -78,6 +78,7 @@
         while(1){
             int rand_num = rand()%MAN_MAXCNT+1;
             int repeat=0;
+			if (rand_num > 120) { rand_num = 33; } // reward for #33 ^^
             for(int j=0;j<i;j++){
                 if( gift[j] == rand_num ) repeat=1;
             }