Microbit Project 2
- gsantoro2
- Sep 21, 2021
- 1 min read
Project 2 was to create some sort of game involving LEDS and at least one button press. This was tricky to think about so I had to look on Microsoft's website for the Microbit coding for some inspiration. In the end I came up with the idea of a guessing game where the Microbit chooses the numbers 1 or 2 at random and the corresponding LED would light up as a result with the number displayed on the screen.

Luckily there was a coding block that allowed for the Microbit to randomly choose numbers between the numbers the Coder inputs. I created a variable for this called Number Guess and set an If/Else statement using it. If the Microbit chose 1 then the screen would display the number and the red LED would light up as a result. If it chose 2 then the blue LED would light up instead. This was all activated by the press of button A while button B would reset the LEDS, although this could've been simplified and put after the If/Else statement if I wanted. The start up screen is a quick little repeat of two triangles, just to have some character to it. The point of the game is for the player to guess either 1 or 2 and then see if they were correct.
Комментарии