BYTE sendBuffer[] = "Hello";
while(1)
{
GLED = LED_OFF;
YLED = LED_ON;
res = radioSend(sendBuffer, sizeof(sendBuffer), remoteAddr, DO_NOT_ACK );
halWait(200);
YLED = LED_OFF;
halWait(200);
if(res == TRUE)
{
GLED = LED_ON;
halWait(200);
}
else
{
GLED = LED_OFF;
halWait(200);
}
}
就是这个程序!谢谢了!
请问该怎么编程呢,我觉得你这个不错!
追答定义一个全局的flag,开始设为false
初始化定时器
编写定时器中断函数:
。。。
当时间间隔为2s时flag = true
。。。
编写while语句块
{
。。。
。。。
if(flag)
break;
}