This prototype extends the one described in the previous section to make a single player game that includes a 'paddle' drawn on left-hand edge of the screen. The position of the paddle is determined by a potentiometer (ADC1) fitted to the evaluation board that provides a voltage input to the Analog-Digital (A-D) Converter.
Begin by creating a new folder named
helloPong_c2v0
, and within this, a new project. Configure the RTE to include board support software components for the Graphic LCD (API) and A/D Converter (API). Alternatively, clone the folderhelloBounce_c2v0
, from the previous recipe and modify the RTE. Use Resolve to automatically load any missing libraries.Copy
helloBounce.c
andhelloBounce.h
from the previous recipe, rename themhelloPong.c
andhelloPong.h
, and include these in your project. Change the#include
inhelloPong.c
, and replacehelloBounce.h
withhelloPong.h
. Build the program and test it as before.Add
#include "Board_ADC.h"
and...