Own IR remote control with RC5 protocol.

Hello. I would like to create own IR remote control (arduino + buttons with IR sender). But as all knows, the most popular remote control are using 0 address which is connected to TV. And if You press on Your RC5 remote control power button You can turn off Your device and Your TV.

How can I change addressing of send code by RC5 protocol?

As I see I can use 7;11;13;15;24;25;27;28;30;31 (they are reserved).

I would like to use this library ( GitHub - Arduino-IRremote/Arduino-IRremote: Infrared remote library for Arduino: send and receive infrared signals with multiple protocols ), but as I have wrote, I dont know how to change address to other than TV.

Regards

The IRremote library has an awful parametrization of the RC5 protocol. The device number (Philips says "system") is in fact bits 6 to 10 (counting the rightmost bit as 0), interpreted in most significat bit first. For example, xxxxxyyyyyy is the command binary yyyyyy to the address binary xxxxxx. Even more concrete: 00101000111 is the command 7 to address 5. (This is not the full story, there are two more bits...)

You can generate IRremote code directly from the RC5 parameters using IrScrutinizer.

Or you can use my library Infrared4Arduino, available in the library manager with the name "Infrared". See the exampe Rc5Renderer. It parametrizes RC5 the right way.

Did it help? Do you need a more detailed explanation?