waitForTrigger
Wait until a trigger reaches the specified active state.
Parameter
| Key | Type | Description |
|---|---|---|
| id | string | Trigger ID. If omitted, the trigger of printer is used. |
| printer | string | Printer ID. Used when id is omitted; required if more than one printer is available. |
| state | boolean | The active state to wait for. Required. |
| 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 {"id": "trigger1", "state": true, "timeout": 5.0}