cyborg5 / IRLib2

Library for receiving, decoding, and sending infrared signals using Arduino
GNU General Public License v3.0
384 stars 138 forks source link

Decode RC5 from cable (no carrier frequency) #79

Open MischaBoender opened 4 years ago

MischaBoender commented 4 years ago

I'm trying to decode some IR signals from a "Control Bus" (Cambridge CXN), but I'm having some problems. Protocol is RC5, but there is no carrier frequency. Got it working fine on a RPi with LIRC and some python code, but I would like to run it directly on a microcontroller.

Here's my code:

#include <Arduino.h>
#include <IRLibDecodeBase.h>
#include <IRLib_P03_RC5.h>
#include <IRLibCombo.h>
#include <IRLibRecvPCI.h>

IRrecvPCI myReceiver(21);
IRdecode myDecoder;

void setup() {
  Serial.begin(115200);
  Serial.println("Enable IR In");
  myReceiver.enableIRIn();
}

void loop() {
  if (myReceiver.getResults()) {
    myDecoder.decode();
    myDecoder.dumpResults(true);
    myReceiver.enableIRIn();
  }
}

And part of the output:

Enable IR In
Decoded Unknown(0): Value:0 Adrs:0 (0 bits) 
Raw samples(100): Gap:53460
  Head: m838  s942
0:m1726 s1833   1:m838 s942              2:m838 s942    3:m838 s941
4:m1727 s1833   5:m837 s943              6:m1726 s1833  7:m837 s943
8:m31767 s959   9:m835 s1834             10:m1726 s944  11:m835 s1834
12:m837 s942    13:m1727 s1833           14:m837 s942   15:m1727 s944

16:m835 s944    17:m836 s1833            18:m31641 s959 19:m836 s1833
20:m1726 s1833  21:m837 s943             22:m837 s943   23:m837 s942
24:m837 s943    25:m837 s942             26:m1727 s944  27:m836 s944    
28:m832 s1836   29:m25407 s1848          30:m838 s942   31:m1726 s1833

32:m837 s943    33:m836 s943             34:m838 s942   35:m837 s943    
36:m837 s942    37:m1717 s954            38:m835 s1833  39:m838 s942
40:m12114 s1848 41:m837 s942             42:m1727 s1832 43:m838 s942
44:m838 s942    45:m837 s943             46:m837 s942   47:m838 s942

48:m1726
Extent=209709
Mark  min:832    max:31767
Space min:941    max:1848

Any help would be much appreciated!