() button pressed?
<( v) button pressed?::microbit>
Category micro:bit
Type Boolean

The () button pressed? block is a Boolean block used as part of the micro:bit extension. This block will detect if the micro:bit has a certain button pressed. By default, the block checks for the A button being pressed.

Example Uses

Document.png Please expand this section. You can help by adding more information if you are an editor. More information might be found in a section of the talk page. (April 2020)

This block reports whether a button on the micro:bit is pressed, so it has many uses.

  • Reporting whenever a specific button is pressed
if <(A v) button pressed? :: microbit> then
 say [Button pressed!]
end
  • Making a sprite move when the specified buttons are pressed
if <(A v) button pressed? :: microbit> then
 move (10) steps
end
if <(B v) button pressed? :: microbit> then
 move (-10) steps
end

See Also