Unlike MakeCode, Python on the Micro:bit doesn’t have event blocks like ‘on button A pressed’. Instead, we use the infinite ‘while true’ loop to keep checking if a button has been pressed (actually, MakeCode programs do the same thing when they run on your Micro:bit, but MakeCode hides the infinite loop from you when you’re writing your code).
So far, we have created code that makes the device do something. This is called output. However, we also need the device to react to things. Such things are called inputs. It’s easy to remember output is what the device puts out to the world whereas input is what goes into the device for it to process. The most obvious means of input on the Micro:bit are its two buttons, labelled A and B. Somehow, we need MicroPython to react to button presses.
Performance Expectations
Guiding Ideas
Using ‘while true’ and ‘if’ commands create your first input program
Try other emotion image such as ASLEEP, CONFUSED or MEH
Design your own 'emoticon' using the LED display
Use the badge to show if you need help or make class voting badges with ticks or crosses
Design a way of wearing your Micro:bit badge using thread, or tape (don't use safety pins as the metal could damage your Micro:bit)
Write the code of dice and check the output.
Disclaimer: All content under this course is customized according to the requirement of an educator/student (K12) filtered from Minecraft Education Edition, MakeCode