# Using Serial Monitor with Native Port

**URL:** <https://forum.arduino.cc/t/using-serial-monitor-with-native-port/318753>\
**Category:** Zero\
**Created:** [June 18, 2015, 6:34am UTC](https://forum.arduino.cc/t/using-serial-monitor-with-native-port/318753 "2015-06-18T06:34:38Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![Rfuzer](https://avatars.discourse-cdn.com/v4/letter/r/ecccb3/32.png) [@Rfuzer](https://forum.arduino.cc/u/Rfuzer)\
**Post date:** [June 22, 2015, 9:43pm UTC](https://forum.arduino.cc/t/using-serial-monitor-with-native-port/318753/7 "2015-06-22T21:43:18Z")

</div>

I'm using the native port as emulated serial port (USB-CDC) with "SerialUSB" to write/read data from Serial Monitor. When I send a first message this code works well, but, when I send some others messages, the recived data are lost as if the buffer does not supply a message.

Here is my simple code:

void setup()  
{

SerialUSB.begin(115200);  
while (!SerialUSB) ;

}

void loop()  
{  
String aux = " ";  
SerialUSB.flush();  
while( SerialUSB.available() \> 0 )  
{  
char c = SerialUSB.read();  
aux += c;  
}  
if(aux != " ")  
SerialUSB.println(aux);

}

---

_[View the full topic](https://forum.arduino.cc/t/using-serial-monitor-with-native-port/318753)._
