Get a string from a incoming Bluetooth data

hi,

I'm working on a proyect where I get a data from my cell phone through the Bluetooth module, which is

"486" I want to get string out of this data and then use the function substring() to do some function with

each number.

The first simple code that I made was to see if I get the right data on my arduino.

void setup()
{
  Serial.begin(9600);
  Serial1.begin(9600);
}

void loop()
{
 if(Serial1.available()>0)
  { 
    Serial.write(Serial1.read());
  }
}

I got "486" on the Serial port as expected.

The problem arrives when I try to make a string of that data. I came with this to see if the data will be

saved on the string:

String bluetooth;

void setup()
{
  Serial.begin(9600);
  Serial1.begin(9600);
}

void loop()
{
 if(Serial1.available()>0)
  { 
    bluetooth = Serial1.read();
    Serial.println(bluetooth);
  }
}

Unfortunately, I got on the Serial port 3 incoming lines with the numbers: "49", "57", "54".

Does someone know a way to make my code possible?

See Robin2's Serial Input Basics.

gfvalvo: See Robin2's Serial Input Basics.

I tried like he say on the post but it does not work. It seams, that code just work to the internal arduino Serial

port.

It seams, that code just work to the internal arduino Serial

That is complete rubbish. YOU wrote YOUR code incorrectly. Post YOUR code so we can see how you screwed it up, and tell you how to fix it.

jkarlos4: I tried like he say on the post but it does not work.

You need to post your program so we can see what you did.

My examples will work fine with SoftwareSerial or HardwareSerial

...R