In other languages

Help the wiki!

The Scratch Wiki is made by and for Scratchers. Do you want to contribute?

Learn more about joining as an editor!

See discussions in the Community Portal

Sensor ()? (block)

(Redirected from Sensor ()?)

Sensor ()?
2.0 Sensor ().png
Category Sensing (PicoBoards in 2.0)
Type Boolean

The Sensor ()? block is a Sensing block and a Boolean block. The block checks if the button on a PicoBoard is being pressed or the specified port connected; if the button is pressed or the port is connected, the block returns true; if it is not, it returns false.

This block can only be used with a PicoBoard.

This is the only boolean block that can be displayed as a Stage monitor. Please note that before Scratch 2.0, there was also another boolean stage monitor.


The drop-down menu.

The block has the following options in the drop-down menu:

  • button pressed
  • A connected
  • B connected
  • C connected
  • D connected

Example Uses

As this block lets the project communicate with the outside world, it can be used to operate projects without using the keyboard and mouse; instead, the button can be pressed or the ports connected and disconnected.

Some common uses for the Sensor ()? block:

  • Using a physical button to control a project
  • Check if wires are connected properly

See Also

  • This page was last modified on 22 August 2016, at 03:00.