Help with Serial.print

Well, I have a cellular shield and i can use X-CTU to type in all the at commands to send text msgs. EX:

at+cmgf=1

at+cmgs="214244****"
then i can type in what i want to send.

and then the ctrl-z.

i need a way to print these msgs with a Serial.print.
I'm trying to make it so if i press a push button it types these commands in using the serial print.

Any ideas?, is this even possible?

Hi,

you can use the following sequence:
Serial.println("at+cmgf=1");
Serial.println("at+cmgs="214244****"");
Serial.print("This is my message");
Serial.write(26); // this is ctrl-z

To encode ctrl-z in a string, you can also use "\032" which is the octal representation of 26.

MikeT