Data Sheet
This program was created in the Microsoft MakeCode Blocks Editor
for the BBC micro:bit.
There is Kitronik package available for the :GAME Controller on
Microsoft MakeCode (the green blocks shown here).
On start-up, the music output pin is changed from the default of
Pin 0 to Pin 2 (the :GAME Controller on-board buzzer signal pin).
The ‘forever’ loop uses blocks which output ‘True’ or ‘False’ to
check whether particular buttons on the Controller have been
pressed, and then uses an ‘if else’ statement to trigger different
outputs. When Fire 1 is pressed, the buzzer will play a short tune,
and when Fire 2 is pressed, the motor will vibrate for 250ms.
The other blocks which can be used to check whether Controller
buttons have been pressed are used to trigger events when any of
the Joypad buttons are pressed. When the particular direction
buttons are pressed, an arrow will be displayed on the micro:bit
screen pointing in the direction of the button.
Microsoft MakeCode Blocks Editor Code
:GAME Controller for the BBC micro:bit
www.kitronik.co.uk/5644