ME218A Project: The Price Is
Right
Team
Members: Andrew Fahrland, Kristina Babiarz, Josh Oechslin
Overview
Team
8’s project was a spin-off version of the TV game show The Price Is right. The game
consisted of two stages: a price-guessing stage and a wheel-spinning stage. In
the first price-guessing stage, the user is presented with a household item
whose price they must guess more than a randomly generated guess by the
computer. If the player gets closer to the true price than the computer’s
guess, they proceed to the second half of the game. In the second half of the
game, the player gets to spin the big wheel on the front of the game on which
price divisions are printed. The player accumulates money by landing on certain
positions on the wheel. The player’s goal is to get as close to $1.00 without
going over. Again, the computer generates a random guess which the player must
compete against to win. If the player wins both rounds, a motorized dispenser
awards the player a gumball.
Price
Guessing
The
main interactions with the player during the price guessing stage are text
printed to a LCD display, a rotary dial and a button. Game instructions as well
as the item to be bid upon are displayed on the LCD screen. The player turns
the dial to select a price and the current price is displayed in real-time on
the LCD screen. When the player is happy with the price they’ve entered, they
push the button on the front panel to enter their guess.
LCD Interaction
The
LCD is controlled by 10 output bits on the C32: a register select line, an
enable line and 8 data bits. Text is slowly scrolled across the screen by
printing a letter at a time with a small delay between screen writes.
Button and Dial
The
button is a simple SPST toggle switch which toggles state every time the button
is pressed. The button output is hooked to an input port on the C32 whose state
is polled by the code’s event checker. The dial is connected to a rotary
potentiometer whose wiper is connected to one of the analog to digital
converter ports on the C32. The dial’s state is polled every 256 milliseconds
when the price is being displayed on the screen.
Wheel
Spinning
If
the player beats the computer’s guess in the first stage, they go on to the
wheel spinning stage. In this part of the game, the player gets to spin the
wheel and try to get as close to $1.00 as possible. They must get closer to
$1.00 than a randomly generated guess between 60 cents and a dollar by the
computer. Sixteen price divisions on the front of the wheel range between 5
cents and 1 dollar. The wheel’s position is tracked using an optical encoder as
detailed here.
Swag
Dispensing
If the player successfully
beats both parts of the game, they are awarded a gumball by the game’s swag
dispenser. The swag dispenser consists of a drum with a hole drilled in it that
rotates under a reservoir of gumballs. When the hole points upward, a gumball
falls in and is then dumped out when the drum rotates downwards. The drum is
rotated by a gear motor and the dispenser was calibrated to reliably dispense a
single gumball by adjusting the speed and duration of the motor’s rotation.
Electronics
A
full schematic of the electronics package used to control the game is shown here.
Code
Our
pseudocode and C code used to control the C32 is shown with full comments here.
Budget
Our
budget is shown here.