Arduino使用sim800l发送SmS

时间:2017-01-29 04:46:02

标签: string arduino gsm

如何使用Sim800l模块将电话号码写入arduino ... 正确的代码就是这个     serialSIM800.write("AT+CMGS=\"+639261001204\"\r\n"); 我想将电话号码更改为字符串,以便我可以发送任何号码......

void send()
 {
     digitalWrite(led, HIGH);
     serialSIM800.begin(9600);
     delay(1000);
     char s1 = "AT+CMGS=\"+";
     char s2= number;
     char s3="\"\r\n"";
     char sms = s1+s2+s3;
     //Set SMS format to ASCII
     serialSIM800.write("AT+CMGF=1\r\n");
     delay(1000);
     //Send new SMS command and message number
     serialSIM800.write(sms);
     delay(1000);
     //Send SMS content
     serialSIM800.write("Your student Go inside the School");
     delay(1000);
     serialSIM800.write((char)26);
     delay(250);
 }

0 个答案:

没有答案