waitForTrigger
Wait until a trigger reaches the specified active state.
Parameter
| Key | Type | Description |
|---|---|---|
| name | string | Trigger name. |
| state | boolean | The active state to wait for. |
| timeout | number | Timeout 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}