不太懂内部原理的渣渣自己试着改了个程序
[mw_shl_code=c,true]#include <IRremote.h>
IRsend irsend;
unsigned int open_button1[67]={
8850,4550,500,1700,500,650,450,650,500,600,500,650,450,600,500,650,500,600,500,1750,450,650,500,1750,450,1750,500,1750,450,1750,500,1750,450,1750,500,600,500,1750,500,600,500,1700,500,650,500,600,
500,1750,450,1750,500,1700,500,650,500,1700,500,650,450,1750,500,1750,450,650,500,600,500
};
unsigned int open_button2[67]={
8900,4500,550,1700,500,600,500,600,550,600,500,600,500,600,500,600,550,600,500,1700,500,650,500,1700,500,1700,550,1700,500,1700,550,1700,500,1750,500,600,500,1700,500,650,500,600,500,1700,500,650,
500,1700,500,1700,550,1700,500,650,450,1750,500,1700,500,650,500,1750,450,650,450,650,500
};
int RECV_PIN=11;
IRrecv irrecv(RECV_PIN);
decode_results results;
void setup()
{
Serial.begin(9600);
irrecv.enableIRIn();
}
void loop()
{
if(irrecv.decode(&results))
{
if(results.value==0x97483BFB)
{irsend.sendRaw(open_button1,67,38);irrecv.resume();delay(5000);}
else if(results.value==0xF0C41643)
{irsend.sendRaw(open_button2,67,38);irrecv.resume();delay(5000);}
}
}[/mw_shl_code]
想实现自己的遥控器发射遥控电视的效果,然后发现似乎只能发射接收一次,求教。。。应该是循环部分的问题。。但逻辑似乎没有错误
|