M Mostez Well-Known Member Licensed User Longtime User Sep 5, 2016 #1 Hello, I have serial output HMI device (DWIN touch LCM) connected to serial2 on Arduino Mega, the problem is I want to make timed serial input to get data from this device, for example to call 'enter password screen' and then wait for user to enter password, click cancel, or timeout occur, in other words serial input inside sub code. this serial input process may be called again for another purpose like, enter item code and so on. any ideas how to implement this in B4R Thanks
Hello, I have serial output HMI device (DWIN touch LCM) connected to serial2 on Arduino Mega, the problem is I want to make timed serial input to get data from this device, for example to call 'enter password screen' and then wait for user to enter password, click cancel, or timeout occur, in other words serial input inside sub code. this serial input process may be called again for another purpose like, enter item code and so on. any ideas how to implement this in B4R Thanks
Erel B4X founder Staff member Licensed User Longtime User Sep 5, 2016 #2 Always read the serial input with AsyncStreams. You need to store the current state in a global variable. The state can be a constant number that you use to know what you are expected to do with the input (which sub to call for example). Upvote 0
Always read the serial input with AsyncStreams. You need to store the current state in a global variable. The state can be a constant number that you use to know what you are expected to do with the input (which sub to call for example).