FREE SHIPPING ON ALL KITS! – US orders Details

Free shipping on all US orders over $60. 

Shop Now

littleBits "Dice"

May 12, 2014
2

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

STEP 1

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

project
Little Big Planet 3 to Littlebits!

I am the biggest fan of Little Big Planet 3!!! So I wanted to find a way to connect Little Big Planet 3 to my new f...

4
2
project
Interactive t-shirt

“Create your interactive t-shirt” was a workshop created for children, to promote the connection between design and technologies ...

5
1
project
8-bit Jukebox

The 8-bit Jukebox is a chiptune music box powered by littleBits’ new Arduino module. The module is programmed with 4 differen...

8
1