NEW Explore the Scratch Block Dictionary, tutorials, textbook, and classroom guides

Start learning →

when (A) button pressed (micro:bit) — Scratch Block Guide

📌 What you will learn

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.

Example using when (A) button pressed (micro:bit)
  1. When A button pressed
  2. Change y by 30
  3. 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.

Back to Extensions See the overview and patterns for Extensions. Learn more → Scratch Block Dictionary (All Categories) Browse Motion, Looks, Sound, Events, Control, Sensing, Operators, Variables, and Extensions. Learn more →

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.