Spiel: Touch Pins

Spiel: Touch Pins

This guide is about the program of a game that is controlled via the pins

Easy

30 mins

from 8 years on

The aim of this game is to press the corresponding pins pointed to by the arrow in the LED.

programming

Programming is done in the MakeCode Editor, no extensions are necessary.

Program code

  • The variable “SpielStart” is needed to easily start and end the game.
  • One of the 4 pin functions is always called at random to call up the arrows alternately.
  • The arrow always points to the pin that must be pressed as quickly as possible.
  • If you press the right pin, you get a point, if you press the wrong one, a point is deducted.
  • To display the score on the LED, you need two variables X and Y and the drawing block from the LED's category.
  • Variables ensure the correct display of points on the LED, especially minus points.
LED-Matrix

This is how the matrix for LED block X and Y is structured.