Introduction:
Our final project code calls for the implementation of an amusement game often bannered as “Test-Your-Strength” or less accurately (but more commonly) known as “Whack-a-Mole.” Our machine is in essence a miniturized version of what can be found in most theme parks across the world. Its construction involves a spring load plastic cap to act as a surface for contact, a wooden mallet which the player uses to hit the plastic cap, and most importantly, a device, called an accelerometer, to measure the shock forces created by the impact of the mallet and the cap surface. A potential player would proceed to hit the plastic cap with the mallet provided, and depending on the level of force registered by the accelerator, a winning or losing result will be annouced visually through a liquid crystal display and light emitting diodes, as well as musically through the use of a speaker.

Schematic:
The schematic layout of our project is realized as follows:
An 8535 development board was choosen for this project because we require an analog to digital conversion process to capture voltage values (as a function of g forces experienced) as they are registered by the accelerometer. Having decided on a chip to use for our project, we proceeded to the programming stage. Our approach was to design a state-machine with three states. The following paragraphs will explain the functions and reasoning behind each state.

Machine States:
Upon power up, our machine enters a welcome state. In this state, the following events occur: First, a series of tones are played through the speaker, and each note has an associated LED that lights up accordingly. The LCD displays a welcoming message, and the keypad is sensed for any button presses. At this point, the game operator has the option of setting game input sensitivity for a male or female player. A force of 49g and 40g is required to win in the male and female modes respectively.
Light Emitting Diodes:
Sychronized with the beats of music are sixteen light emitting diodes driven by two Radio Shack 74HCT138 demultiplexors. Seeing that the number of output pins on our microprocess are quickly being taken up by switches, LCD, accelerometer, and speaker, we see no way of driving sixteen LEDs without the use of a bus output to some sort of decoder. The Radio Shack decoder was choosen for its simplicity and ability to drive 20mA of current at each output pin. A pair of 74HCT138 takes output from pins b1 to b3 and lights up LEDs as required. Output to LEDs are always latched until the next timer zero overflow interrupt. This allows for easy sychronization with music when needed. If a LED is to maintain its value, then the same value can always be relatched into output register (LED).
Read more: Whack-A-Cap: miniature representation of a popular amusement game
