m (Capitalization and SB guidelines: Fixed since it is more than one line)
m (Scratchblocks)
 
Line 1: Line 1:
 
{{block
 
{{block
 
|name = When () button pressed
 
|name = When () button pressed
|image = when [ v] button pressed :: extension hat
+
|image = when [ v] button pressed :: microbit hat
 
|category = [[Event Blocks|Event]], [[micro:bit]]
 
|category = [[Event Blocks|Event]], [[micro:bit]]
 
|type = [[Hat Block|Hat]]
 
|type = [[Hat Block|Hat]]
Line 11: Line 11:
 
== Example Uses ==
 
== Example Uses ==
 
<scratchblocks>
 
<scratchblocks>
when [ v] button pressed :: extension hat
+
when [ v] button pressed :: microbit hat
 
display [ v] :: extension
 
display [ v] :: extension
 
</scratchblocks>
 
</scratchblocks>
Line 17: Line 17:
  
 
<scratchblocks>
 
<scratchblocks>
when [ v] button pressed :: extension hat
+
when [ v] button pressed :: microbit hat
 
move (10) steps
 
move (10) steps
 
</scratchblocks>
 
</scratchblocks>

Latest revision as of 17:16, 19 February 2020

When () button pressed
when [ v] button pressed :: microbit hat
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 [ v] button pressed :: microbit hat
display [ v] :: extension

Triggering an event on the micro:bit.

when [ v] button pressed :: microbit hat
move (10) steps

Triggering an event on a project's sprite.