Go Down

Topic: Custom Risk board with Electronic Dice - NEED HELP! NEWB! (Read 1 time) previous topic - next topic

tyefire

Jun 17, 2012, 01:24 am Last Edit: Jun 17, 2012, 05:21 am by tyefire Reason: 1
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

wanderson

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.

Code: [Select]

#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...
}
New true random number library available at: http://code.google.com/p/avr-hardware-random-number-generation/

Current version 1.0.1

tyefire

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"!

ematson5897

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

tyefire

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.

wanderson

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:

http://code.google.com/p/mutiplex7seg/
https://github.com/csdexter/MAX7219
https://www.google.com/search?source=ig&hl=en&rlz=1G1GGLQ_ENUS395&q=arduino+seven+segment&oq=arduino+seven+&aq=0&aqi=g6&aql=&gs_l=igoogle.1.0.0l6.545.3803.0.7296.14.12.0.2.2.0.149.1187.9j3.12.0...0.0.ar6x_TkIsH4

New true random number library available at: http://code.google.com/p/avr-hardware-random-number-generation/

Current version 1.0.1

tyefire

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?

Nick Gammon


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.

MichaelMeissner

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.  ]:D :) 8) :smiley-roll:

wanderson

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 http://code.google.com/p/avr-hardware-random-number-generation/source/browse/#git%2FEntropy%2Fexamples%2FDice and I made a short video of my wire wrapped prototype to show how it functions, available from http://code.google.com/p/avr-hardware-random-number-generation/downloads/detail?name=2012-06-25_11-29-15_780.3gp&can=2&q=#makechanges

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!
New true random number library available at: http://code.google.com/p/avr-hardware-random-number-generation/

Current version 1.0.1

spruce_m00se

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

Go Up