Bumper Switch#
Introduction#
The Bumper Switch is a spring-loaded digital sensor that detects physical contact or impact with an object.

Below is a list of available blocks:
Bumper Switch pressed? – Returns whether the specified Bumper Switch is currently pressed.
when Bumper Switch – Runs the attached stack of blocks when the specified Bumper Switch is pressed or released.
Bumper Switch pressed?#
The Bumper Switch pressed? block returns a Boolean indicating whether the Bumper Switch is currently being pressed.
True – The Bumper Switch is being pressed.
False – The Bumper Switch is not being pressed.
<[BumperSwitchA v] 按下了?>
Parameter |
Description |
|---|---|
device |
Which Bumper Switch to use, configured in the Devices window. |
当开始
[Display a message when the Bumper Switch is pressed.]
等到 <[BumperSwitchA v] 按下了?>
在屏幕上打印 [Bumper Switch pressed!]▶
when Bumper Switch#
The when Bumper Switch block runs the attached stack when the specified Bumper Switch is pressed or released.
当 [BumperSwitchA v] [pressed v] :: hat events
Parameter |
Description |
|---|---|
device |
Which Bumper Switch to use, configured in the Devices window. |
state |
When to run the attached stack of blocks:
|
当 [BumperSwitchA v] [pressed v] :: hat events
[Display a message when the Bumper Switch is pressed.]
在屏幕上打印 [Bumper Switch pressed!]▶