0

我正在使用 arduino 开发基于 IR 的远程控制应用程序。经过长时间的探索,我发现了一些 Raw Ir 代码,看起来像 -

"IR": "40064,1,1,96,24,24,24,48,24,24,24,24,24,48,24,24,24,24,24,48,24,24,24,24,24,24,24,24,1057,96,24,24,24,48,24,24,24,24,24,48,24,24,24,24,24,48,24,24,24,24,24,24,24,24,1057,96,24,24,24,48,24,24,24,24,24,48,24,24,24,24,24,48,24,24,24,24,24,24,24,24,5128"
enter code here

很遗憾,即使在得到这段代码后我也无法理解这段代码,我正在使用这个 aruino 库 - https://github.com/z3t0/Arduino-IRremote

发送原始代码的地方是这样的 -

void  IRsend::sendRaw (const unsigned int buf[],  unsigned int len,  unsigned int hz){
// Set IR carrier frequency
enableIROut(hz);

for (unsigned int i = 0;  i < len;  i++) {
    if (i & 1)  space(buf[i]) ;
    else        mark (buf[i]) ;
}

space(0);  // Always end with the LED off
}

其中 buf 是一个数组,包含以微秒为单位的间隔,在此期间信号将是低电平或高电平。但是我上面得到的 IR 代码不起作用,因为我认为它没有时间间隔,而是其他东西。任何领导都会很亲切。

4

0 回答 0