gpio: IGpioPort[];
Value | Description |
---|---|
GpioPolarityResult.HIGH | Pulse has a high value. |
GpioPolarityResult.LOW | Pulse has a low value. |
GpioPolarityResult.JOB_SETTINGS | Pulse parameters are taken from the specification in the GPIO Mapping settings in the job. |
/** * Sends a pulse to the n-th port if the n-th tool execution was successful. * @param {IMainArguments} input_result - object with results of the job. * @returns {IMainResult} - object defining outputs per interface. */ export function onResults(input_result) { // For each tool for the FlowBuilder // take the success value, if positive send HIGH pulse let gpio_results = []; for (let i = 0; i < input_result.tool_results.length; ++i) { if (DEVICE.gpio.ports[i].state === GpioPortState.OUTPUT) { if (input_result.tool_results[i].success) { gpio_results.push({ port_number: i, polarity: GpioPolarityResult.JOB_SETTINGS }) } } } return { gpio: gpio_results }; }