ARDUINO LUDO Dice


                                                                                  

USES-:


1. Durability as Compared to Normal Dice, as it will not be lost.


REQUIREMENTS-:


1. 7 Segment Display Common Anode

2. 2 Push Button Switch


3. Jumper Wires



4. VeroBoard



5. Arduino with Power Input Pin



6. 9 volt Battery with Cap 


PROCEDURE-:

1. Fix the Pins In the Vero-Board Through soldering Don't Cut Pins.

2. Connect the 3rd Pin And 5th Pin as shown in video.


3. Now  Provide Each Pin With a Female to Male Jumper Wire Except 5th Pin and one of the 3rd or 8th Pin and Do the Connection As Shown Below-


4. Now Connect the Dice Button and Reset Button To Analog Inputs of Arduino A0 and A1 Respectively. Like this-


5. Now Go For Testing ANd Uploading the Arduino Code Here Is the ArduinoCode-
#define resett 15



#define dice 14







char digit[6]={0x02, 0x79, 0x24, 0x30, 0x19, 0x12};



int pin[7]={9,8,7,6,5,4,3};



void setup()



{



for(int i=0;i<7;i++)



pinMode(pin[i], OUTPUT);



pinMode(dice, INPUT);



pinMode(resett, INPUT);



digitalWrite(dice, HIGH);



digitalWrite(resett, HIGH);



int temp=0x40;



for(int i=0;i<7;i++)



{



int temp1=temp&0x01;



digitalWrite(pin[i], temp1);



temp=temp>>1;



}



delay(1000);



}







void loop()



{



int temp=rand();







if(digitalRead(dice)==0)



{



int k=temp%6;



temp=digit[k];



wait();



for(int i=0;i<7;i++)



{



int temp1=temp&0x01;



digitalWrite(pin[i], temp1);



temp=temp>>1;



}



delay(200);



}







if(digitalRead(resett)==0)



{



temp=0x40;



for(int i=0;i<7;i++)



{



int temp1=temp&0x01;



digitalWrite(pin[i], temp1);



temp=temp>>1;



}



}



}







void wait()



{



for(int m=0;m<10;m++)



{



for(int k=0;k<6;k++)



{



int ch=digit[k];



for(int l=0;l<7;l++)



{



char tem2=ch&0x01;



digitalWrite(pin[l], tem2);



ch=ch>>1;



}



delay(50);



}



}



}
6. Now Create Your Case my Craft is weak and connect 9 volt battery as shown-


Video Tutorial -: