how to use concat()... is necesary on this case?

Hello! :o

reading the sintax here

it say: string.concat(parameter) but i can not understand it.

i have to send an SMS with sensors data, the library i'm using sends messages this way:

sms.SendSMS("+569551xxxx",message);

so... if i have multi variable like battery volt and distance how can i concat that and display someting like "hi the battery voltage is volt and de distance distance"

is too bad this?:
message.concat("hi te battery voltage:"volt" and de distance "distance);

or

sms.SendSMS("+569551xxxx","hi te battery voltage:"volt" and de distance "distance);

Put as much of the message into the String variable message as you can. Then use concat() REPEATEDLY to append the other parts of the message. This is one way but there are others.

The usual advice is to avoid String on a limited memory CPU such as most Arduinos. You may be forced to use String.

You have not provided a link to your SMS library so I do not know if you can send a message using a C string instead of using a String.

vaj4088:
Put as much of the message into the String variable message as you can. Then use concat() REPEATEDLY to append the other parts of the message. This is one way but there are others.

The usual advice is to avoid String on a limited memory CPU such as most Arduinos. You may be forced to use String.

You have not provided a link to your SMS library so I do not know if you can send a message using a C string instead of using a String.

Hi Vaj,

libraries are:

#include "sms.h"
#include "SIM900.h"

this is the shield

http://www.tinyosshop.com/image/cache/data/ARDUINO/Shield/GSMSHIELD-600x600.jpg

http://www.tinyosshop.com/datasheet/GSM_GPRS_GPS_Shield_GSMSHIELD.rar

:smiley: found it on youtube!! it is a normal adition, i didn’t know that as strings. the ram is a problem for this?

The small amount of RAM means that String may easily fragment the available memory.

Unfortunately, there are several SMS libraries, so the #include line is of little help. However, if you have successfully used the plus sign to concatenate String values, then you currently have no further need for help from me. Good Luck!