Limit Switch#
Introduction#
The Limit Switch is a small digital sensor that detects physical contact with an object.

Below is a list of available blocks:
Limit Switch pressed – Returns whether the specified Limit Switch is currently pressed.
when Limit Switch – Runs the attached stack of blocks when the specified Limit Switch is pressed or released.
Limit Switch pressed#
The Limit Switch pressed Boolean block reports whether or not a Limit Switch is being pressed. This can be used to check if the robot bumps into other objects.
True – The Limit Switch is being pressed.
False – The Limit Switch is not being pressed.
<[LimitSwitchA v] pressed?>
Parameter |
Description |
|---|---|
device |
Which Limit Switch to use, configured in the Devices window. |
when Limit Switch#
The when Limit Switch hat block runs the attached stack of blocks when the selected Limit Switch is pressed or released.
when [LimitSwitchA v] [pressed v] :: hat events
Parameter |
Description |
|---|---|
device |
Which Limit Switch to use, configured in the Devices window. |
state |
When the attached stack of blocks will run: pressed will run when the Limit Switch is pressed down, and released runs when the Limit Switch is released. |