Skip to main content

Get strings from Serial.read()

I want to read strings from Serial.read() to send them latter.

To get the data from the Serial monitor I'm doing this:

 String stringOne  = "";
 int  incomingByte; 


if (Serial.available() > 0) {
  
  
  while(Serial.available() > 0)
  {
     incomingByte= Serial.read();
     stringOne = String(stringOne + String(incomingByte));

    
    
  }
  
  Serial.println(stringOne);
   stringOne = "";

The issue is that when I type:

'a'

I got:

'97'

for 'abc'

I got

'979899'

so on and so forth.

What should I do in order to get the same string I type?