Where to find IR codes for Arduino

Sorry if this is a stupid question, but where would I find IR codes to use with a library like IRlib2 or IRremote, without using an IR reciever? For instance, I have an LG TV that uses NEC codes, but where would I find a list of them in a format I can use on an Arduino?

Find IR codes is one of many sites found with a search for "lg tv ir codes".

groundFungus: Find IR codes is one of many sites found with a search for "lg tv ir codes".

I found that site when I was searching, but how would I convert the codes into the hexadecimal format for the IRlib2 or IRremote libraries?

Look at the examples that come with the IR libraries. There are several such as IRanalyze, IRrecord, etc., that will simply hook up a receiver and display on the monitor the code received. Works with any remote. Program it yourself.

DKWatson: Look at the examples that come with the IR libraries. There are several such as IRanalyze, IRrecord, etc., that will simply hook up a receiver and display on the monitor the code received. Works with any remote. Program it yourself.

I’m asking how to do it without a reciever. I don’t have the remote.

You might find the codes you need on the LIRC site.

FWIW I also have an LG TV and for my project used the codes found on that site. I wrote a header file with the following:

const long  PRE_DATA = 0x20df0000;    // prefix for remote command

enum COMMAND {
            up,
            down,
            left,
            right,
            ok
};

int tv_codes[] = {
                    0x02FD,       // up
                    0x827D,       // down
                    0xE01F,       // left
                    0x609F,       // right
                    0x22DD        // ok 

                    
};

Commands are sent to the TV with the function:

/*
  sendCmd

 Send passed commend to IR reciever.

 */
void sendCmd(COMMAND cmd)
{
  // combine pre data with specific code
  irsend.sendNEC(PRE_DATA | (long)(tv_codes[cmd] & 0xffff),32);

  // we must move deliberately to avoid missed clicks
  delay(300);

}

which is called, for example, like this:

sendCmd(up);

[quote author=Blue Eyes link=msg=3914937 date=1540176290] You might find the codes you need on the LIRC site.

FWIW I also have an LG TV and for my project used the codes found on that site. I wrote a header file with the following:

const long  PRE_DATA = 0x20df0000;    // prefix for remote command

enum COMMAND {
            up,
            down,
            left,
            right,
            ok
};

int tv_codes[] = {
                    0x02FD,       // up
                    0x827D,       // down
                    0xE01F,       // left
                    0x609F,       // right
                    0x22DD        // ok 

                    
};

Commands are sent to the TV with the function:

/*
  sendCmd

 Send passed commend to IR reciever.

 */
void sendCmd(COMMAND cmd)
{
  // combine pre data with specific code
  irsend.sendNEC(PRE_DATA | (long)(tv_codes[cmd] & 0xffff),32);

  // we must move deliberately to avoid missed clicks
  delay(300);

}

which is called, for example, like this:

sendCmd(up);

[/quote] Thank you very much! That is exactly what I was looking for.