Roulette Wheel?

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
bcook65
 
Posts: 109
Joined: Sat Apr 03, 2010 1:25 pm

Roulette Wheel?

Post by bcook65 »

Hello
I am a VP of our Amateur Radio club, and at our monthly meetings we all sit around and try to decide where we will be eating prior to the following months meeting..
I am thinking it would be interesting to make that process a little easier or technical.. lol
What I would like to do is plug in a list of maybe 20-30 restaurants and other places to choose from.. basically all I want to do is I push a button have some leds flash in random sequence and have it randomly pick a name and either lite up the corresponding led for that name and or just do it all on an lcd display.

Not sure if a roulette wheel would be the correct name for this but not sure if this is something simple or much more involved.
Could use an arduino Im guessing..

Any ideas?

Thanks

Bill

User avatar
adafruit_support_bill
 
Posts: 88091
Joined: Sat Feb 07, 2009 10:11 am

Re: Roulette Wheel?

Post by adafruit_support_bill »

That sounds like a fairly straightforward, (but fun!) project.

An Arduino Uno http://www.adafruit.com/products/50
and an RGB/LCD shield http://www.adafruit.com/products/714
Would be the hardware I'd start with.

The Arduino Random function would make the programming pretty easy.
http://arduino.cc/en/Reference/random

odometer
 
Posts: 98
Joined: Sun Aug 21, 2011 11:01 pm

Re: Roulette Wheel?

Post by odometer »

adafruit_support_bill wrote:The Arduino Random function would make the programming pretty easy.
http://arduino.cc/en/Reference/random
Be aware of the difference between random and pseudorandom.

User avatar
adafruit_support_bill
 
Posts: 88091
Joined: Sat Feb 07, 2009 10:11 am

Re: Roulette Wheel?

Post by adafruit_support_bill »

Be aware of the difference between random and pseudorandom.
Good point. The RandomSeed() function can help to randomize things further.

tldr
 
Posts: 466
Joined: Thu Aug 30, 2012 1:34 am

Re: Roulette Wheel?

Post by tldr »

adafruit_support_bill wrote:
Be aware of the difference between random and pseudorandom.
Good point. The RandomSeed() function can help to randomize things further.
random seed without a randomly generated seed will still give you the same sequence every time. so figure out what number it's going to generate, then put your favorite restaurant at that point in the list.

odometer
 
Posts: 98
Joined: Sun Aug 21, 2011 11:01 pm

Re: Roulette Wheel?

Post by odometer »

I suppose you could seed it with the micros() at the time you press the button. Unless your finger has microsecond-precise timing, I figure that will be pretty darn random.

User avatar
adafruit_support_bill
 
Posts: 88091
Joined: Sat Feb 07, 2009 10:11 am

Re: Roulette Wheel?

Post by adafruit_support_bill »

random seed without a randomly generated seed will still give you the same sequence every time.
As noted in the documentation RandomSeed() called with an analogRead() on an unconnected analog pin will yield a fairly random result.

tldr
 
Posts: 466
Joined: Thu Aug 30, 2012 1:34 am

Re: Roulette Wheel?

Post by tldr »

adafruit_support_bill wrote:
random seed without a randomly generated seed will still give you the same sequence every time.
As noted in the documentation RandomSeed() called with an analogRead() on an unconnected analog pin will yield a fairly random result.
i didn't mean to imply that getting the same result every time would be a bad thing and as a vegetarian i would be sorely tempted to build a strong bias into such a system.

odometer
 
Posts: 98
Joined: Sun Aug 21, 2011 11:01 pm

Re: Roulette Wheel?

Post by odometer »

tldr wrote:i didn't mean to imply that getting the same result every time would be a bad thing and as a vegetarian i would be sorely tempted to build a strong bias into such a system.
That's why I would just use dice, or cards... or mahjong tiles.

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”