GPRS模块调试

GPRS模块调试

最终打样出来的成品如下图:
在这里插入图片描述
在这里插入图片描述

2、github仓库 代码: https://github.com/echo0110/GPRS-.git
废话不多说 先上代码:

#include “timer.h”
#include “sys.h”
#include “delay.h”
#include “usart.h”
#include “103.h”
#include “led.h”
#include “beep.h”
#include “key.h”

volatile uint8_t i; //47–2017-7-3 19:07

//2017-7-4 16:17

//VNC

int main(void) //
{

u8 t;
u8 len;	
u16 times=0;  
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);//
delay_init(168);		//
//clearBuff();//
uart_init(115200);	//´
//LED_Init();		  		//
printf("AT\r\n");//
delay_ms(1000);
printf("AT&F\r\n");
delay_ms(1000);
printf("AT+CGCLASS=\"B\"\r\n");
delay_ms(1000);

printf("AT+CGDCONT=1,\"IP\",\"CMNET\"\r\n");
delay_ms(1000);

printf("AT+CGATT=1\r\n");
delay_ms(1000);

printf("AT+CLPORT=\"TCP\",\"2000\"\r\n");	
delay_ms(1000);
 printf("AT+CIPMODE=1\r\n"); //͸´« 

 printf("AT+CIPSTART=\"TCP\",\"221.226.69.234\",\"6002\"\r\n");	//
 delay_ms(1000);delay_ms(1000);delay_ms(1000);delay_ms(1000);

memset(receBuf, 0, 81);
receCount=0;
while(1)
{
printf(“AT+CIPSTART=“TCP”,“221.226.69.234”,“6002”\r\n”);
// delay_ms(1000);
if(Recevstate==1) //Èç¹ûÊÕµ½Ò»Ö¡Êý¾Ý //receCount=15
{
Recevstate=0;
// i=0;
jieshou_handle();

    receCount=0;    			 
	}
printf("AT+CIPSTART=\"TCP\",\"123.57.41.13\",\"1005\"\r\n");
	//	delay_ms(1000);delay_ms(1000);delay_ms(1000);delay_ms(1000);

while(USART_GetFlagStatus(USART2,USART_FLAG_TXE)!= SET);
}
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

echo-niuben

你的鼓励是我创作的巨大动力!

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值