• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
MKT-porter
博客园    首页    新随笔    联系   管理    订阅  订阅
arduino控制SIM900A模块

https://item.taobao.com/item.htm?spm=a1z09.2.0.0.5fc02e8dncAF2p&id=604968021102&_u=i1qf7bf5f4ec

 

 

 

 

 

 

 

 

 

 请注意

后面是 回车 结束

  void sendMeg()
  {
   
  Serial.println("AT");
  delay(2000);
  Serial.println("AT+CMGF=1");
  delay(2000);
  Serial.println("AT+CMGS=\"PHONENUMBER\"");//这里改成你的号码
  delay(2000);
  Serial.print("Test\r\n");//这里写内容
  delay(2000);
  Serial.write(0x1A); //原来这里我是“Serial.print(0x1A);”,一直调不出来,后来改了才成功了,那酸爽
  
 }
void setup() {
  // put your setup code here, to run once:
 
  Serial.begin(9600);
}


void loop() {
  // put your main code here, to run repeatedly:
  delay(15*1000);
  sendMeg();
}

  

posted on 2019-11-18 01:36  MKT-porter  阅读(1629)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3