Button#

Introduction#

The VEX 123 Robot features four buttons that can detect whenever they are pressed.

Below is a list of available blocks:

  • pressed? – Returns a Boolean indicating whether or not a button was pressed.

pressed?#

The pressed? returns a Boolean indicating whether or not a specified button was pressed.

  • True - The button is being pressed.

  • False - The button is not being pressed.

<[ifbuttonleft v] 按下了?>

Parameters

Description

button

The button to detect presses from:

  • Left
  • Right
  • Move
  • Sound

Example

当开始
[Drive after the sound button is pressed.]
等到 <[soundIcon v] 按下了?>
驱动 [向前 v]