1

我正在做我最后一年的项目,但我遇到了一个找不到答案的问题。我尝试解码空调的红外信号。我已经使用 Arduino 和 Raspberry PI (LIRC) 解码了 raw 和 hex,但是当我发送信号时我的空调没有打开。AC 品牌是 Acson。我在做什么我认为这是正确的,因为当我发送解码信号时我的电视会打开和关闭。我还尝试以不同的频率(36 kHz、38、40、433 ......)发送原始代码。他们似乎都没有工作。请帮我......

这些是打开/关闭按钮的原始代码(它们每次都在变化):

1)未知编码:4F15BD0C(32位)

Raw (132): 8932 4550 -2550 300 -450 300 -1000 300 -1000 300 -450 300 -1000 250 -500 300 -450 300 -450 300 -400 300 -500 250 -500 300 -950 300 -450 300 -450 300 -450 300 -1000 300 -1000 300 -450 300 -450 300 -1000 300 -950 300 -450 300 -450 300 -450 300 -450 300 -1000 300 -1000 300 -450 300 -400 300 -500 300 -450 300 -450 300 -400 300 -450 300 -500 300 -400 300 -1000 300 -450 300 -450 300 -450 300 -450 300 -450 300 -450 300 -450 300 -1000 300 -450 300 -450 300 -450 300 -950 300 -1000 300 -450 300 -450 300 -450 300 -1000 300 -450 300 -450 300 -450 300 -450 300 -450 300 -1000 250 -450 300 -1000 300 -1000 300 -450 350 

2)未知编码:4F15BD0C(32位)

Raw (132): -21344 4550 -2600 300 -450 300 -1000 300 -950 300 -450 300 -1000 300 -450 300 -450 300 -450 300 -450 300 -450 300 -450 300 -1000 300 -400 300 -500 250 -500 300 -950 300 -1000 300 -450 300 -450 300 -1000 300 -1000 250 -500 300 -450 300 -450 250 -450 300 -1000 300 -1000 300 -450 300 -450 300 -450 300 -450 300 -450 300 -450 300 -450 300 -450 300 -450 300 -950 300 -500 300 -450 300 -450 250 -450 300 -450 300 -500 300 -400 300 -1000 300 -450 300 -450 300 -450 300 -1000 300 -1000 300 -450 300 -450 300 -400 300 -1000 300 -450 300 -450 300 -450 300 -450 300 -450 300 -1000 300 -450 300 -1000 300 -1000 300 -450 350 

3)未知编码:4F15BD0C(32位)

Raw (132): -3150 4550 -2600 300 -450 300 -1000 300 -1000 250 -450 300 -1000 300 -450 300 -450 300 -450 300 -450 300 -450 300 -450 300 -1000 300 -400 300 -500 300 -450 300 -950 300 -1000 300 -450 300 -450 300 -1000 300 -1000 250 -500 300 -450 300 -450 300 -400 300 -1000 300 -1000 300 -450 300 -450 300 -450 300 -450 300 -450 300 -450 300 -450 300 -450 300 -450 300 -950 300 -500 300 -450 300 -450 300 -400 300 -450 300 -500 250 -450 300 -1000 300 -450 300 -450 300 -450 300 -1000 300 -1000 300 -450 300 -450 300 -400 300 -1000 300 -500 250 -450 300 -450 300 -450 300 -450 300 -1000 300 -450 300 -1000 300 -1000 300 -450 350 

这是我用于解码部分的代码:

int RECV_PIN = 2;

IRrecv irrecv(RECV_PIN);

decode_results results;

//#define RAWBUF 255

void setup()
{
 Serial.begin(9600);
 irrecv.enableIRIn(); // Start the receiver
}

// Dumps out the decode_results structure.
// Call this after IRrecv::decode()
// void * to work around compiler issue
//void dump(void *v) {
//  decode_results *results = (decode_results *)v
void dump(decode_results *results) {
 int count = results->rawlen;
 if (results->decode_type == UNKNOWN) {
   Serial.print("Unknown encoding: ");
 }
 else if (results->decode_type == NEC) {
   Serial.print("Decoded NEC: ");
 }
 else if (results->decode_type == SONY) {
   Serial.print("Decoded SONY: ");
 }
 else if (results->decode_type == RC5) {
   Serial.print("Decoded RC5: ");
 }
 else if (results->decode_type == RC6) {
   Serial.print("Decoded RC6: ");
 }
 else if (results->decode_type == PANASONIC) {  
   Serial.print("Decoded PANASONIC - Address: ");
   Serial.print(" Value: ");
 }
 else if (results->decode_type == JVC) {
    Serial.print("Decoded JVC: ");
 }
 Serial.print(results->value, HEX);
 Serial.print(" (");
 Serial.print(results->bits, DEC);
 Serial.println(" bits)");
 Serial.print("Raw (");
 Serial.print(count, DEC);
 Serial.print("): ");

 for (int i = 0; i < count; i++) {
   if ((i % 2) == 1) {
     Serial.print(results->rawbuf[i]*USECPERTICK, DEC);
   }
   else {
     Serial.print(-(int)results->rawbuf[i]*USECPERTICK, DEC);
   }
   Serial.print(" ");
 }
 Serial.println("");
}


void loop() {
 if (irrecv.decode(&results)) {
   Serial.println(results.value, HEX);
   dump(&results);
   irrecv.resume(); // Receive the next value
 }
}

而这个用于向 AC 发送原始信号:

void setup()
{
 Serial.begin(9600);
}

void loop() {

  for (int i = 0; i < 1000; i++)
  {
       // send variable sonyPower in length 31 at 40 Khz
       irsend.sendRaw(turnOff,131,433);

       delay(3000);
  }
}

更新

我使用 IrLib 获得了此信息...

IrLIB 详细信息

4

0 回答 0