自己做一个操作,用一个标记或时间作配码动作
if (Flash30s)
{
ReceivAddr0 = ReceiveBuf[0];
ReceivAddr1 = ReceiveBuf[1]; //读码
Flash30s = 0; //清除对码状态
BeepCnt = 200; //响蜂鸣器
}
然后ReceivAddr0,ReceivAddr1存E2里,在程序开机时读取这两个地址,和遥控器接收到的地址码对比
if (ReceiveBuf[0] == ReceivAddr0 && ReceiveBuf[1] == ReceivAddr1)
{;} |