Hi, how can i send a text message with a variable inside? something like this:
SIM900.print(User1);
(but this one doesn't work at all...)
User1 is char variable that contains a phone number...
Hi, how can i send a text message with a variable inside? something like this:
SIM900.print(User1);
(but this one doesn't work at all...)
User1 is char variable that contains a phone number...
User1 is char variable that contains a phone number...
A char variable can not hold a phone number. A char ARRAY can.
Post ALL of your code.
And do some research. There are only about 5687287852887128 threads on this forum asking the same question. And, the answer is that it is dirt simple.
Thanks PaulS for answer...i made it work, with this:
SIM900.print(parametros.User1);
it was easier than what i thought...but how can i combine that with text? like this:
SIM900.print(" User 1: " + parametros.User1);
how can i concatenate that??
how can i concatenate that??
You don't need to. The modem can't tell whether the data sent to it was sent using one, two, or thirty-five print() calls.
what do you mean?? i can do this for example:
SIM900.print("This was");
SIM900.print("only to");
SIM900.print("showe the");
SIM900.print("variable: ");
SIM900.print(parametros.User1);
and all this is going to be sent in 1 text message?
Edit:
no, it didn't work..only sent the texts, not the variable..
no, it didn't work..only sent the texts, not the variable..
No more from me until you post ALL of your code.
else if (Admin_q >= 0)
{
Remitente_SMS();
if ( Remitente == parametros.Admin) {
SIM900.print("AT+CMGF=1\r");
delay(1000);
SIM900.println("AT+CMGS=\"" + Remitente + "\"");
delay(1000);
SIM900.print(parametros.User1); here is the variable, that it's sent perfectly like this..
delay(100);
SIM900.println((char)26);
delay(100);
SIM900.println();
}
i just want to add some text before the variable...
i just want to add some text before the variable...
You have a warped understanding of ALL.