Array to Strings

First I would like to say that I have looked this up in Google but I guess I either don’t understand the problem well enough or the answers are not for my specific instance of the problem…
I am just trying to take serial input and add the value to the sMessage string.

int i, MessageLength, Message[10];

void setup()
void loop()
  String Smessage(Message);
  if( == '

Can someone lead me in the direction of what I am doing wrong??)
    for(i=0; i<10; i++)
    Message[i] =;
MessageLength = i;
for(i=0; i<MessageLength; i++)

Can someone lead me in the direction of what I am doing wrong??

The only two things you are doing right are using setup() and loop()

Never use String it just wastes memory.

Ensure that you use the correct type Message should be char not int.

Never assume that the whole of a message available.

Assuming your message starts with a $ and end with /. Read and throw away chars until the $

Then read and store the chars in message until the /

Use an FSM (look in the playground) to deal with the above and the fact that most of the time where will be nothing to read.

After that as your using string (array of char) and not String there is no conversion issue!


Further to what holmes4 just said, look up Serial.available() and it's usage example.

Per OldSteve: