您好,我在做GPRS和单片机模块的通信部分,但是不知道具体怎么编程实现 10
2个回答
展开全部
我用的是sim300模块程序你参考一下:
uchar code enter[] = {0x0D,0x0a};
cc:
pushchars(0,2,"AT");
sent(2,1);
strcpy(counter,enter);
sent(2,1);
delay(200);
if(ordernum!=8) goto cc;
while(ordernum!=9);
pushchars(0,4,"ATE0");
sent(2,3);
pushchars(0,2,enter);
//sent(1,1);
sent(2,1);
pushchars(0,50,"AT+CIPSTART=\"UDP\",\"182.97.112.207\",\"6000\"");
sent(2,40);
delay(10);
pushchars(0,2,enter);
//sent(1,1);
sent(2,1);
delay(2000);
//sent(1,1);
//while(1);
while(1)
{
strcpy(counter,"AT+CIPSEND");
sent(2,9);
strcpy(counter,enter);
sent(2,1);
counter[0]=0x1A;
sent(2,0);
}
uchar code enter[] = {0x0D,0x0a};
cc:
pushchars(0,2,"AT");
sent(2,1);
strcpy(counter,enter);
sent(2,1);
delay(200);
if(ordernum!=8) goto cc;
while(ordernum!=9);
pushchars(0,4,"ATE0");
sent(2,3);
pushchars(0,2,enter);
//sent(1,1);
sent(2,1);
pushchars(0,50,"AT+CIPSTART=\"UDP\",\"182.97.112.207\",\"6000\"");
sent(2,40);
delay(10);
pushchars(0,2,enter);
//sent(1,1);
sent(2,1);
delay(2000);
//sent(1,1);
//while(1);
while(1)
{
strcpy(counter,"AT+CIPSEND");
sent(2,9);
strcpy(counter,enter);
sent(2,1);
counter[0]=0x1A;
sent(2,0);
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2011-08-15
展开全部
网上有很多,csdn就有,百度也有
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询