Software Examples
3.4.7
SliderBall Game
This application was designed to show the functioning ability of the two Capacitive Touch sliders in
conjunction with the LCD from the 430BOOST-SHARP96 BoosterPack.
To enter the application, the SliderBall game option on the main menu must be highlighted and the right
button (S2) then pushed. The SliderBall game requires the player to use a sliding paddle to keep the ball
in play. The goal of the game is to keep the ball alive and on the screen by having it hit off of the two
paddles at each end of the screen. Users start off with five lives to accumulate as many points as
possible. For each time that the ball is blocked by the paddle, points are awarded. The higher the
difficulty, the more points are awarded for each hit. Each time the ball reaches the end of the screen and
the paddle has not hit the ball, the user loses a life. After the life is lost, the ball automatically starts again
for another round. This repeats until all lives are exhausted, and the game is over. If the high score has
been achieved, a congratulations screen will be displayed to notify the user. At this point the final score,
as well as the board high score will be displayed and the user may then choose a new level of difficulty to
play once again.
To navigate the user levels menu and choose an option, the left capacitive touch slider and right button
are used similar to all previous menus. The user may choose between the following: easy, normal, hard,
and Insane. After selecting a difficulty, the game will begin to start, with the ball moving to the right-hand
side first. Both capacitive touch sliders are used to control their respective paddles along the side of the
screen. When the user misses the ball, it will be held in place for a few cycles before starting to move
again to give the user a chance to regroup following losing a life. To create "easier" versions of the game,
sleep cycles are added to slow down the game play.
The high score for each user level is stored in FRAM and is retained on subsequent power cycles. This
value is erased only when the device is re-programmed.
3.4.8
Special Notes: Inverting the Display Color Scheme
A feature that has been built in to the demo code is the ability to invert the display colors. This can be a
useful feature for times when the original display color settings are difficult to read.
To invert the colors edit the file 'sharp96x96.h' within the 'grlib' directory. In the 'User Configuration for the
LCD Driver' section under 'Invert Display Option' use either one of the # defines 'NORMAL_DISPLAY' or
'INVERT_DISPLAY' as needed.
When INVERT_DISPLAY is defined it allows the demo to display with a black background and white
foreground once the demo code is re-downloaded onto the MSP-EXP430FR5969 board.
3.5
430BOOST-SHARP96 Graphics Library Demo
NOTE:
This graphics library demo is dependent on the 430BOOST-SHARP96 BoosterPack that
comes with the MSP-BNDL-FR5969LCD bundle.
The grlib demo shows how to use the MSP430 Graphics Library
http://www.ti.com/tool/msp430-grlib
or
"grlib," in a project with the Sharp
®
display. This demo cycles screens without user interaction to show
simple graphics primitives.
•
Pixels
•
Lines
•
Circles
•
Rectangles
•
Text
•
Images
The demo introduces the functions to configure grlib such as initialization, color inversion, and using
foreground and background colors properly.
32
MSP430FR5969 LaunchPad™ Development Kit (MSP
‑
EXP430FR5969)
SLAU535B – February 2014 – Revised July 2015
Copyright © 2014–2015, Texas Instruments Incorporated