All programs need a beginning.
Events trigger a stack of instructions (the code inside them).
This example shows how the micro:bit can have multiple events.
When the program starts it displays the text string "Hello World!".
It then shows a smiley face forever.
When the A button is pressed it displays the letter 'A'.
When the B button is pressed it displays the letter 'B'.
When the micro:bit is shaken it shows a sick face!
The purple input events will interrupt the 'forever' event, but not the 'on start' event.
An action that can trigger stack of code in a computer program. Events could happen at any time.
Data that is entered into a computer system, this can be manually or by using sensors.
A sensor that detects changes in acceleration. It is used to detect movement. You will find accelerometers in smartphones and game controllers (like the controllers for the Nintendo Switch).