This article is about the micro:bit Extension block. For the EV3 Extension block, see Button () Pressed? (block).
() Button Pressed?
( v) button pressed?
Category micro:bit
Type Boolean

The () Button Pressed? block is a boolean block and a micro:bit block. Its options are "A", "B", and "any". The block returns whether or not the specified button is being pressed on the micro:bit unit.

Example Uses

  • Displaying when a specific button is pressed
if <(any v) button pressed?> then
 say [Button pressed!]
end
  • Movement based on pressing certain buttons
if <(A v) button pressed?> then
 move (10) steps
end
if <(B v) button pressed?> then
 move (-10) steps
end