ece lab5 proposal

1
Charles Moyes (cwm55) and Shentong Wang (sw477) Lab 5 Project Proposal Lab 5 Project Proposal - Craps Game Idea The idea is to implement a playable game of Craps (casino dice rolling game) using the MSP430 microcon- troller board. External LEDs arranged in dice shaped format will be used to show the values of the dice rolls. A basic description of the game rules can be found at: http://en.wikipedia.org/wiki/Craps Current limiting resistors will be connected across the LEDs and the digital +5V IO pins in series to ground. The push button will be used to trigger dice rolls. The built-in green and red LEDs on the MSP430 board will indicate whether the “Pass” (green LED lit) or the “Don’t Pass” (red LED lit) betters win the round. The Craps embedded system will act as dice for each player in the game, and as such, will be passed around the table to each player who wishes to be a “shooter.” Pseudo-random Number Generator A pseudo-random number generator will be used to determine the values of the dice rolls in software. The Linear Congruential Generator algorithm based on modulo arithmetic seems to fit the bill: X n+1 (aX n + c)(mod m) where X n is the sequence of values generated and m, a, c, and X 0 (the so-called seed) are constants. Because the microcontroller board lacks a built-in real-time clock, the value of the on-chip temperature sensor instead will be used to seed the random number generator (X 0 ). Hardcoding a random number generator seed into the code would make playing the game much less interesting since upon rebooting, all games would have the same sequence of dice rolls and thus would not be random. Bill of Materials For this project we will need 7x red LEDs (Part #: COM-09590 on Spark Fun), 7x green LEDs (Part #: COM-09592 on Spark Fun), 1 yellow LED (Part #: COM-09594 on Spark Fun), a piezoelectric speaker (Part #: COM-07950 on Spark Fun), 15x 150 Ω resistors (resistance values calculated to match the chosen LEDs), and a 1K Ω resistor to limit current across the speaker. It is probably a good idea to have some extras of each component in case we mess up. Additional Features If time permits, possible extensions to this idea include using audio feedback via a piezoelectric speaker to communicate game state by sending PWM signals out of one of the I/O pins. Another idea is to implement more rules of the game such as the dealer “On” button using an additional LED to signal which phase of the round that the game is in {come-out, point}, although this state is implicitly encoded by the value of the first dice roll in the rules of the game so it is not entirely necessary. 1

Upload: chuck-moyes

Post on 02-Jul-2015

78 views

Category:

Documents


6 download

TRANSCRIPT

Page 1: Ece lab5 proposal

Charles Moyes (cwm55) and Shentong Wang (sw477) Lab 5 Project Proposal

Lab 5 Project Proposal - Craps Game

Idea

The idea is to implement a playable game of Craps (casino dice rolling game) using the MSP430 microcon-troller board. External LEDs arranged in dice shaped format will be used to show the values of the dicerolls. A basic description of the game rules can be found at:

http://en.wikipedia.org/wiki/Craps

Current limiting resistors will be connected across the LEDs and the digital +5V IO pins in series to ground.The push button will be used to trigger dice rolls. The built-in green and red LEDs on the MSP430 boardwill indicate whether the “Pass” (green LED lit) or the “Don’t Pass” (red LED lit) betters win the round.The Craps embedded system will act as dice for each player in the game, and as such, will be passed aroundthe table to each player who wishes to be a “shooter.”

Pseudo-random Number Generator

A pseudo-random number generator will be used to determine the values of the dice rolls in software. TheLinear Congruential Generator algorithm based on modulo arithmetic seems to fit the bill:

Xn+1 ≡ (aXn + c)(mod m)

where Xn is the sequence of values generated and m, a, c, and X0 (the so-called seed) are constants. Becausethe microcontroller board lacks a built-in real-time clock, the value of the on-chip temperature sensor insteadwill be used to seed the random number generator (X0). Hardcoding a random number generator seed intothe code would make playing the game much less interesting since upon rebooting, all games would have thesame sequence of dice rolls and thus would not be random.

Bill of Materials

For this project we will need 7x red LEDs (Part #: COM-09590 on Spark Fun), 7x green LEDs (Part #:COM-09592 on Spark Fun), 1 yellow LED (Part #: COM-09594 on Spark Fun), a piezoelectric speaker (Part#: COM-07950 on Spark Fun), 15x 150 Ω resistors (resistance values calculated to match the chosen LEDs),and a 1K Ω resistor to limit current across the speaker. It is probably a good idea to have some extras ofeach component in case we mess up.

Additional Features

If time permits, possible extensions to this idea include using audio feedback via a piezoelectric speaker tocommunicate game state by sending PWM signals out of one of the I/O pins. Another idea is to implementmore rules of the game such as the dealer “On” button using an additional LED to signal which phase ofthe round that the game is in come-out, point, although this state is implicitly encoded by the value ofthe first dice roll in the rules of the game so it is not entirely necessary.

1