Help needed for project due 6/3

After reformatting to yield literate form:

  1.  while(!Serial.available())
  {
      ;   //wait until Serial Port (the hardware) is ready
  }
  2.  while(Serial.available()) 
  {
      Serial.read();  //read and discard as long as there is data in Serial Buffer
  }

1. Waiting until hardware of the Serial Port is actually activated/ready.
2. Keep reading and discarding until Serial Buffer is empty to avoid seeing garbage in the Serial Monitor.

1 Like