Skip to main content

waitForTrigger

Wait until a trigger reaches the specified active state.

Parameter

KeyTypeDescription
namestringTrigger name.
statebooleanThe active state to wait for.
timeoutnumberTimeout in seconds. Required.

Return value

{position: number} with the encoder position at the moment the trigger fired, or null if the timeout elapsed before the trigger fired.

Example

waitForTrigger {"name": "trigger1", "state": true, "timeout": 5.0}