B4R Question How to convert this code to read Serial.readString();

devpialkt

Member
Licensed User
Longtime User
Hi All,

i have problem to convert this native arduino codes as shown below.
my board based on wemos D1 R1

Thanks

B4X:
void loop() { 

  if (Serial.available() > 0) {
    String incoming = Serial.readString();

    if (incoming.indexOf("{")>=0 && incoming.indexOf("}")>=0) { 
      Serial.flush(); 
      //saveData(incoming);
      //do something here
    }
 
    
  } 
 
}
 

devpialkt

Member
Licensed User
Longtime User
finally, i found 2 links that solved my problem with keyword "AsyncStreams" :
Thanks Erel

https://imgur.com/a/TFHJX8B
TFHJX8B
 
Upvote 0
Top