Waiting for a message in DWC
-
Hi,
I´m want to communicate between duet3 and an arduino.
So far I can send messages to the arduino (M118 ) and receive them when sent via the serial port.What I want to do now is to wait for a specific response after sending a message.
I created a vue button (v-btn) and used this code for the click event below.
What is the right way to do it?async click() { if (!this.waitingForCode) { this.waitingForCode = true; try { await this.sendCode(`M118 P2 S"MyMessageToArduino" L0`); } catch (e) { console.log(e); } // How do I wait for a message sent back from the arduino? Let´s say I want to wait for G555 or any other message... this.waitingForCode = false; } },
thanks for your help
Moosi