6. Use buttons in RPiSparkModule

The first HelloWorld program in (Section 4.1) gives you a first look at RPiSparkModule development. In this section we complete a new simple program and use the Joystick of RPi-Spark. In this new program we draw a ball in the middle of the OLED display, then use the Joystick to control the ball to move up and down, left and right, and the ball's range of motion is limited to the OLED screen area (128 x 64).

RPiSpark buttons layout:

RPi-Spark v1.1 button layout

  • 15-SWA and 16-SWB connect buttons A and B respectively. Simply wire to ground and you will get the same effect as pressing button A or B.

 

Was this article helpful?

YES     |     NO

 

Enjoying the project? Spotted a mistake? Any opinions on the website? Let us know!