Roulette Wheel?
Moderators: adafruit_support_bill, adafruit

Roulette Wheel?

by bcook65 on Tue Jun 04, 2013 11:10 pm

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
BCook65
Electricity is your friend and your friend needs a hug... :O
bcook65
 
Posts: 83
Joined: Sat Apr 03, 2010 1:25 pm

Re: Roulette Wheel?

by adafruit_support_bill on Wed Jun 05, 2013 6:18 am

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
User avatar
adafruit_support_bill
 
Posts: 30781
Joined: Sat Feb 07, 2009 10:11 am

Re: Roulette Wheel?

by odometer on Sun Jun 09, 2013 5:21 pm

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.
odometer
 
Posts: 98
Joined: Sun Aug 21, 2011 11:01 pm

Re: Roulette Wheel?

by adafruit_support_bill on Sun Jun 09, 2013 5:30 pm

Be aware of the difference between random and pseudorandom.

Good point. The RandomSeed() function can help to randomize things further.
User avatar
adafruit_support_bill
 
Posts: 30781
Joined: Sat Feb 07, 2009 10:11 am

Re: Roulette Wheel?

by tldr on Sun Jun 09, 2013 5:41 pm

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.
"If I had known it was harmless, I would have killed it myself." - Phillip K. Dick, A Scanner Darkly
User avatar
tldr
 
Posts: 466
Joined: Thu Aug 30, 2012 1:34 am

Re: Roulette Wheel?

by odometer on Sun Jun 09, 2013 6:27 pm

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.
odometer
 
Posts: 98
Joined: Sun Aug 21, 2011 11:01 pm

Re: Roulette Wheel?

by adafruit_support_bill on Sun Jun 09, 2013 7:40 pm

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.
User avatar
adafruit_support_bill
 
Posts: 30781
Joined: Sat Feb 07, 2009 10:11 am

Re: Roulette Wheel?

by tldr on Sun Jun 09, 2013 9:34 pm

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.
"If I had known it was harmless, I would have killed it myself." - Phillip K. Dick, A Scanner Darkly
User avatar
tldr
 
Posts: 466
Joined: Thu Aug 30, 2012 1:34 am

Re: Roulette Wheel?

by odometer on Sat Jun 15, 2013 10:58 am

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.
odometer
 
Posts: 98
Joined: Sun Aug 21, 2011 11:01 pm