IR convert HEX to BINARY big time newbie

I have been messing with a bunch of different code for 2.6 IDE. I’m a Total first timer with Arduino. I want to take the HEX value from a remote (NEC) I received from this code(below) and turn it into this binary format so I can copy the binary value into my home theater programming software. I’m guess it needs to be 32 bit. Can you help an old 66 year old dude?
The binary output would look something like this is what I’m expecting:

0000 006D 0000 0022 00AC 00AC 0015 0040 0015 0040 0015 0040 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0040 0015 0040 0015 0040 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0040 0015 0015 0015 0015 0015 0040 0015 0040 0015 0015 0015 0015 0015 0040 0015 0015 0015 0040 0015 0040 0015 0015 0015 0015 0015 0040 0015 0040 0015 0015 0015 0689

#include <IRremote.h>

const int RECV_PIN = 8;
IRrecv irrecv(RECV_PIN);
decode_results results;

void setup(){
Serial.begin(9600);
irrecv.enableIRIn();
irrecv.blink13(true);
}

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

turn it into this binary format so I can copy the binary value into my home theater programming software.

What do you mean by "binary format" in this case? Give an example of what your home theater expects.

Hex, binary and decimal representations are just different, human readable ways of displaying internal data, always stored as binary bits.

These all represent the same internal 16 bit value:

Hex: 0xABCD
Binary: 0b1010101111001101
Decimal: 43981

Would look like
0000 006D 0000 0022 00AC 00AC 0015 0040 0015 0040 0015 0040 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0040 0015 0040 0015 0040 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0040 0015 0015 0015 0015 0015 0040 0015 0040 0015 0015 0015 0015 0015 0040 0015 0015 0015 0040 0015 0040 0015 0015 0015 0015 0015 0040 0015 0040 0015 0015 0015 0689

That is hexadecimal representation.

lol..ok…then how to do that?

Do what?

This line in the code you posted above prints the hexadecimal representation of the stored 32 bit value:
Serial.println(results.value, HEX);

void loop() {
   if( irrecv.decode(&results) ) {
      char buf[10];
      snprintf(buf, sizeof buf, "%04lX ", results.value);
      Serial.print(buf);
      irrecv.resume();
   }
}

So my code produces this in the window FF5AA5
How do I convert to what looks like

0000 006D 0000 0022 00AC 00AC 0015 0040 0015 0040 0015 0040 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0040 0015 0040 0015 0040 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0015 0040 0015 0015 0015 0015 0015 0040 0015 0040 0015 0015 0015 0015 0015 0040 0015 0015 0015 0040 0015 0040 0015 0015 0015 0015 0015 0040 0015 0040 0015 0015 0015 0689

Ok…I will give those a try…thanks for input

This appears to be the hexadecimal representation of about 70 16 bit numbers. What do those ~70 numbers represent? What would your home theater do with them?

Although the above snippet does what you asked (display result.value as a 4 digit, 0 padded number), I strongly suspect that that is not at all what you are wanting to have happen.

I patiently await the actual question. :popcorn:

Example NEC IR CODE 7F01 4A

Go to this url and put that value in Yamaha IR Hex Converter

That’s what I’m expecting

Finally, we come to it.

The question actually is:

"How do I convert a NEC IR code to a Yamaha IR code?"

You will have to figure out what the Yamaha IR Hex Converter is doing. I imagine that it is converting the IR code into bit timing information.

One approach would be for you to take the printed output of this statement
Serial.println(results.value, HEX);
and type it into the Yamaha converter web page.

Sort of…the remote I have sends NEC codes so trying to convert that to this long 1’s and 0s value

Ok..well like I said..I’m really newbieish …so maybe this is more difficult than I thought

"Sort of?" :popcorn: :popcorn:

Perhaps examining the function on that web page that does all the heavy lifting might be illuminating. In any case, good luck with your project, which, by the way, has nothing to do with converting hex to binary.

function GenerateProntHexFromNecCode() {

   var strComp32BitBinary;
   var strBinary = iNec32bitCode.toString(2);

   //convert to full 32 bit binary string
   if( strBinary.length < 32 ){
      var strZeros = "00000000000000000000000000000000"
      var strComp32BitBinary;
      strComp32BitBinary = strZeros.substring( 0, 32 - strBinary.length );
      strComp32BitBinary = strComp32BitBinary + strBinary;
   }else{
      strComp32BitBinary = strBinary;
   }

   strProntoHexCode = "0000 006D 0022 0002 0155 00AA ";
   for( var j = 0; j < 4; j++ ){
      var strByte = strComp32BitBinary.substring( j * 8, (j+1)*8 );

      for( var i = 0; i < 8; i++ ){
         if( strByte.charAt(7-i) == '0' ){
            //0
            strProntoHexCode = strProntoHexCode + "0015 0015 ";
         }else{
            //1
            strProntoHexCode = strProntoHexCode + "0015 0040 ";
         }
      }					
   }

   var strFinish = "0015 05ED 0155 0055 0015 0E47 ";
   strProntoHexCode = strProntoHexCode + strFinish;
}

So here is the doc on my remote

But like I said trying to get this into the long format

This page has some info and might be helpful. The code appears to be proprietary, but this person appears to have figured out at least some of it:

My expectations for my new arduino might be harder than I thought. I was thinking if it’s a NEC code that converting the hex value to binary would be the same. But maybe the manufactures of the remotes make it more proprietary