Cyber Monday extended! 20% off any order. Spend $250, get 25% off! Use code CYBER. Details

Ends Tuesday 12/1 at 11:59pm PST. Exclude Gift Cards. Educators use code CYBEREDU for equivalent discount.. Shop Now >

littleBits "Dice"

May 12, 2014

Many games involve tossing a pair of dice.  Here is a littleBits Arduino sketch that simulates tossing a pair of dice for two players.  Of course, if there are more that two players, then the dice can be shared, as in any game with real dice.  Each player simply pushes his or her button, and the results of the toss of the pair of dice are displayed as the two digits on a number module. 

Click on the m4v movie file below to see littleBits "Dice" in action.

See the alternate image on the left for which each player has a mounting board with his/her button and number module attached.

How To Make It


Construct the circuit shown in the picture. Note that the Arduino module's micro-USB cable must be connected to your computer, and the computer must have the Arduino IDE software installed. The number modules should be set to "values" (not "volts"). THE ARDUINO SWITHCES SHOULD BOTH BE SET TO ANALOG. Set the dimmer switch to a random position each time before you load the sketch--this will make the odds high that you will get different dice toss results each time the Arduino with this sketch is powered up. Power up the Arduino module. Start the Arduino IDE software. Select Tools>Board>Arduino Leonardo. Then select Tools>Serial Port and select the serial port that the Arduino will use for communication. This will depend upon whether you are using a Windows, Mac, or Linux machine. Open the sketch file called Dice.ino. Upload the sketch to the Arduino module. After it is loaded you will notice that both number modules read 00. Each player can now toss his or her dice by pressing his or her button. Once you have loaded the Dice.ino program to the Arduino module, you can disconnect the circuit from your computer, and run the dice program wherever you wish!

Related Projects

littleBitty Air Conditioner

Has your room been a little too hot lately? Thinking about having a lemonade stand? A picnic? Prepare for summer with the littleBi...

Mr. Bottle

Bottle doll made with plastic bottle!

Go Hawks! Game Alerter

The Go Hawks! box is a great starter project for using the littleBits cloud module. With minimal supplies from around your house, ...