Set tool digital output.
yield self._wait_until_not_pause()
GLOBAL.XArm.xarm_printed = True
ret = yield self._wait_until_cmdnum_lt_max()
if ret is not None:
return response(client, cmd_id, ret)
ionum = data.get('ionum')
value = data.get('value')
delay = data.get('delay', 0)
code = GLOBAL.XArm.xarm.set_tgpio_digital(ionum, value, delay_sec=delay)
response(client, cmd_id, code)
self.set_gpio_digital = async (ionum, value, callback, delay) => {
const params = window.GlobalConstant.INIT_CMD_PARAMS_COMMON_DATA();
Object.assign(params.data, {
ionum: ionum,
value: value,
delay: (delay !== undefined && delay > 0) ? delay : 0
});
const cmd_id = self.sendCmd(window.GlobalConstant.SET_GPIO_DIGITAL, params, (dict) => {
self.codeHandle(dict, 'set tgpio digital', true);
if (callback) {
callback(dict);
}
});
await self.socketCom.wait(cmd_id);
};