Ok, so like this?
uart.write(`\x03\x10(${_cmd})\n`).then(function() { setTimeout(function() { uart.disconnect(); console.log('output:',data); console.log("Disconnected"); }, 2000); }).catch(function () { console.log("Promise Rejected - disconnect"); uart.diconnect(); });
@MaBe started
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Ok, so like this?