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.
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.
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.
For more detail: Whack-A-Cap: miniature representation of a popular amusement game