1Course of the game
- The Calliope mini is rotated in different directions.
- The rotations are detected by the Calliope mini's position sensor. Rotations on the x-axis switch on the first LEDs up to half of the strip and rotations on the y-axis switch on the second half.
- For an increased difficulty level, a random LED is switched off every second.
- Leuchten alle LEDs des Streifens, ist das Spiel gewonnen und es erscheint ein Regenbogen.
2Accessories
The game works with a NeoPixel LED strip.
3Programming
Programming is carried out in the MakeCode Editor, and the "NeoPixel ” extension must also be loaded.
- The first block determines the length and the connection of the NeoPixel strip.
- The two “Interval” blocks divide the strip into two areas and enable the division for the x and y directions of rotation.
- The values of the position sensor are distributed over a specific area of the NeoPixel and stored in a variable.
- For clarity, half is divided again to cover negative (-90° to 0°) and positive (0° to 90°) rotation angles.
- The previously saved variable can be saved in a list to determine when all LEDs are switched on.
- Every second, an LED is switched off to make the game a little more difficult. To do this, a random value is removed from the list and the corresponding LED is switched off.