When () button pressed
When () button pressed.PNG
Category Event, micro:bit
Type Hat

The When () button pressed block is a hat block used as part of the Micro:bit extension. When either the A button or the B button is pressed, this block triggers an event.

Example uses

When () button pressed example use 1.PNG Triggering an event on the micro:bit

When () button pressed example use 2.PNG Triggering an event on a project's sprite.