When pin () connected
when pin (0 v) connected:: microbit hat
Category micro:bit
Type Hat
Introduced in 3.0

The when pin () connected block is a hat block and a micro:bit block. The block activates when a pin is connected to a wire, crocodile clip or other electronic conductor. The pins are numbered 0, 1, 2.

Example Uses

when pin (1 v) connected
display text [1]
  • Triggering an event on the project's stage.
when pin (2 v) connected
say [Pin 2 is connected!]
Cookies help us deliver our services. By using our services, you agree to our use of cookies.