This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

how to check the data available in serial

Hi...

 i want to read the data from another board using serial uart .. how to write the command to check the data is available ... in arduino i written like this how to write in this case

how to achieve the same thing using nRF52840

void loop() { //Choose Serial1 or Serial2 as required
  if(Serial2.available()) 
  {
    Serial1.print(char(Serial2.read()));
  }
     else if (Serial1.available()) 
     {
    Serial2.print(char(Serial1.read()));
  
}
}

Related