保险杠#
介绍#
The Bumper Switch is a mechanical switch that completes a circuit when pressed, allowing the robot to detect presses and releases.

以下是可用模块列表:
Bumper Switch pressed – Reports a Boolean indicating if the Bumper Switch is being pressed.
when Bumper Switch – Runs the attached stack of blocks when the Bumper Switch is pressed or released.
Bumper Switch pressed#
The Bumper Switch pressed Boolean block reports whether or not a Bumper Switch is being pressed. This can be used to check if the robot bumps into other objects.
True — The Bumper Switch is being pressed.
False — The Bumper Switch is not being pressed
<[BumperA v] 按下了?>
范围 |
描述 |
|---|---|
设备 |
Which Bumper Switch to use, configured in the Devices window. |
当开始
[Display a message when the Bumper Switch is pressed.]
等到 <[BumperA v] 按下了?>
在屏幕上打印 [Bumper Switch pressed!]▶
当保险杠开关#
The when Bumper Switch hat block runs the attached stack of blocks when the selected Bumper Switch is pressed or released.
当 [BumperA v] [pressed v] :: hat events
范围 |
描述 |
|---|---|
设备 |
Which Bumper Switch to use, configured in the Devices window. |
状态 |
When the attached stack of blocks will run: pressed will run when the Bumper Switch is pressed down, and released runs when the Bumper Switch is released. |
当 [BumperA v] [pressed v] :: hat events
[Display a message when the Bumper Switch is pressed.]
在屏幕上打印 [Bumper Switch pressed!]▶