How to receive data automatic?


Recommended Posts

Posted

Hi Admin

I want create a sequence, this sequence can automatic receive data. From my hardware, I can send data in any time and random.

How I can create it?

Thanks in advance.

Posted

So, I'm assuming you mean the device is going to send data async, without polling? If so, you can just do something like this:

while(1)
   try
	  private string datain = device.mydevice.readuntil(13)
	  // do parsing here
   catch()
	  delay(0.05)
   endcatch
endwhile

Archived

This topic is now archived and is closed to further replies.