# Custom Risk board with Electronic Dice - NEED HELP! NEWB!

Hello Arduino community!

I can't tell you how exited I am to get started on my first Arduino project! Part of the project, as a whole, requires electronic dice with a digital display.

Particularly I need; A digital display (like a calculator display) that can show 3 sets of dice that go up to a 6, that can also show only 2 dice going up to 6. It is imperative that the dice results are always random as this is part of a larger 'board game' project (I cant wait to show the final project with wood working and so on). I was hoping I could get the advice, as well as the information needed to put this together on my own.

Now, what I need from the Arduino community (you guys are the coolest nerds on the block! Robots? WHAT?) is information (links, or better yet guides) to relevant information as a newbie attempting this project. A grocery list (Arduino chipset 33025BX Extreme, Digital Display 11432... ha, you know what I mean!) and anything else you think will be useful.

Edit: This is going to be used for a custom Risk board, as such, the die display needs to be able to be inlaid into a wood panel on its own. I was looking at something called 'breadboards' and it looked as though I could not feasibly inlay the display in a position I needed. Thanks guys!
Gentlemen, I'm exited to do this, but I learn by watching other people so your details and advice are what I need. Take me under your wing!
tyefire

Well, if you want random dice I would suggest my Entropy library which uses the jitter associated with the internal timers to produce random numbers. It can be downloaded from the link in my signature block. Here is an example of how to create three random dice rolls for every round through the loop.

``````#include <Entropy.h>

void setup()
{
Entropy.Initialize();
}

void loop()
{
char die1, die2, die3;

die1 = Entropy.random(1,7); // returns integer value of 1 through 6 with equal probability
die2 = Entropy.random(1,7);
die3 = Entropy.random(1,7);
// Do something to display dice results...
}
``````

Alright, that's part of the puzzle! Any other gurus out there?

Ha! I just realized I typed 'exited' instead of excited on the first post... "I have exited to do this guys, make sense do I"!

How large of a display are you looking at? for medium sized I would suggest making an LED display yourself on perfboard

The display would have to be roughly an inch and a half tall or smaller, and I'm looking at either 3 consecutive displays showing each dice roll, or one big display showing the 3 dice rolls. Then alternatively, I would need the option of rolling just 2 die on the board.

It is for a custom Risk board I want to build, to modernize it I want to have electronic dice onboard.

Well, you will want to start by breadboarding your device, until you get everything tested and working. Only then should you build the prototype in a way that you could mount it to your risk board. For three digit display, you will probably want to use a seven segment display. These come in various sizes and colors, so you shouldn't have too much trouble finding what you need.

I haven't used any of these but a perusal of the Arduino playground turned up a few links that may help you:

Now I've found a set of tutorials that will enable to me to make "Arduino Dice" with a 7 segment display on startingelectronics.com

What do I need to do to operate 3 and 2 7-segment displays concurrently using the same process? What would a plan for that look like?

Specifically, would it be the coding that would need to be different (from a single 7 segment display) or the wiring or both? Would I have to make 3 separate dice with separate Arduino Uno Boards? And does a usb cable need to be plugged into an arduino board for something like this to work as it is working?

tyefire:
And does a usb cable need to be plugged into an arduino board for something like this to work as it is working?

No, that is for programming or getting serial data to/from the device. Otherwise you can run it from the power jack.

You know for a risk board, rather than display the dice as numbers, I would think a better display would be to have 7 LEDS per dice (or 14 leds). Of course with that setup, you wouldn't want to control each led with a separate pin, unless you had a Mega. Even with a Mega, you might want to have some way of encoding the leds to set with a few pins. I believe the Matrix example in the learning section deals with this. With LEDS and such, you can always just drill a hole in the wood just big enough for the LED, and keep the wires below it.

An alternative, might be a low res graphic screen, particularly with a touch sensor, so that you could indicate which dice to re-roll.

Of course by listening to me, I probably just made your project even harder. ] 8)

I have produced a new example for my Entropy library that performs precisely this function. The code was designed to be easy to understand, rather than fast, so it is a little unrefined, but should give a good starting point for your risk board. It currently has two multiplexed six-sided dice represented as seven led's for each die. More dice can easily be added. The example, along with schematic and statistical analysis of the code's performance is available from Google Code Archive - Long-term storage for Google Code Project Hosting. and I made a short video of my wire wrapped prototype to show how it functions, available from Google Code Archive - Long-term storage for Google Code Project Hosting.

Before publishing, I ran a test of about 12,000 throws of the dice (used another arduino to 'push' the roll button and record the results. Like all of the other tests (http://arduino.cc/forum/index.php/topic,108380.30.html) run so far, the performance is very good.

Hope this helps!

im only a newb so im afraid i cant be of much use,

but i wholly approve of electronic dice for risk, i will interested to see the result,

also , if you dont go with the 7 led option (which would be really cool)
you could maybe hook up a parrallel lcd display, they are easy to work with, you could get a four line one,
and with a little coding you could use the two bottom lines to announce how many troops each player loses,

imagine

attacker 6 5 5

defender 5 5

attacker loses 1

defender loses 1

that would stop a lot of sneaky cheating in the game, hahahaha