when (A) button pressed (micro:bit) — Scratch Block Guide
Runs a Scratch script when physical button A or B on a connected micro:bit is pressed.
What this block does
Runs a Scratch script when physical button A or B on a connected micro:bit is pressed.
Use a real micro:bit as a wireless game controller for jumping or firing.
- Category: Extensions
- Key tip: Requires Scratch Link and the official Scratch micro:bit HEX firmware.
Working Scratch example
Try building this small script in the Scratch editor, predict what will happen, then click the green flag to test it.
- When A button pressed
- Change y by 30
- Start sound Boing
Try it: Pressing physical button A makes your Scratch character jump.
Related block guides
Explore other blocks in the same category or return to the full English Block Dictionary.
FAQ
When should I use "when (A) button pressed (micro:bit)" in Scratch?
Use a real micro:bit as a wireless game controller for jumping or firing. Requires Scratch Link and the official Scratch micro:bit HEX firmware.
This guide is provided for educational purposes. Scratch screens and terms may change over time, so please check the official Scratch website as well.