2

我搜索了谷歌,找不到与这个确切主题相关的文章。

我有几个遥控器需要手动输入手机上的通用远程应用程序。但是,无论我在哪里查看,我都无法在网上找到这些代码。

是不是有一个红外接收器设备可以让我将遥控器指向,按遥控器上的任何按钮,它会告诉我相应的十六进制代码?我不是很了解 IR 技术,但似乎这样的东西必须存在,否则像 lirc 这样的项目到底是如何获得所有这些代码的?

如果可能的话,我想知道这种设备的名称(如果存在),或者如果不知道如何构建一个的方向。

谢谢!

4

2 回答 2

1

您可以获取一个 IR 接收器组件并使用小型微控制器读取它以获取正在发送的信号,但我不知道如何将其转换为十六进制代码。我见过一些项目只是在需要时播放信号。

关于使用传感器读取信号的一些参考资料:

http://learn.adafruit.com/ir-sensor

http://playground.arduino.cc/Code/InfraredReceivers

有用于通过您的 PC 接收和发送 IR 的框,但同样,我不知道他们是否有办法获取您的应用程序所需的十六进制代码。

http://www.intolect.com/irmandetail.htm

于 2013-12-31T02:28:53.203 回答
0

这可以通过 Arduino 和红外接收器轻松完成,它可以为您过滤掉任何背景信号

我将红外接收器连接到我的 Arduino 上的模拟引脚,并下载了IRremote库来解码红外信号。然后我将解码后的信号打印到 Arduino IDE 串行监视器

将以下代码上传到您的 Arduino,并在 Arduino 仍连接时打开串行监视器以查看收到的十六进制代码

#include <IRremote.h>

// Create an instance of the object to decode the signal from the IR receiver,
// passing in the value of the analog pin you chose
IRrecv irReceiver(A0);
// Create a container for the decoding result
decode_results result;

void setup()
{
  // Ensure the serial monitor is set to the same frequency you pass into Serial.begin
  // in this case 9600
  Serial.begin(9600);
  irReceiver.enableIRIn();
}

void loop()
{
  if (irReceiver.decode(&result))
  {
      irReceiver.resume();
      Serial.println(result.value, HEX);
  }
}

于 2016-07-26T14:23:30.863 回答