Loop over RC5 protocol type signals

Hello Everybody,

So i'm trying to create a remote control using Arduino for some old devices for whom i lost the remote control.

thanks to the help of Experts here, i managed to build a circuit to control my TV using a known RAW signals

Now, i want to control my old Streamium Philips NP2900, i found on internet that it's RC is working under RC5 protocols. so i collected around 2000 signals of a Philips likes devices and i want to try all of them on my streamium hoping one of them could be understood by my NP2900
but my code seems to not be working (the led is flashing but the output of Serial.print doesn't seems good, i ran the code on only 10 signals to begin )

I apologize for this long introduction but i wanted to give as much details as possible

Thank you for the attention you may give for my question.

#include <IRremote.h>

IRsend irsend;
void setup () {  
  Serial.begin(9600);
  unsigned char arr[] ={0x100C, 0x1801, 0x1002, 0x1803, 0x1004, 0x1805, 0x1006, 0x1807, 0x1008, 0x1809};
 
  for (int i = 0; i < 9; i++) {
                   arr[i] = 0 ;
                   Serial.println("Now sending " + arr[i]); 
                   irsend.sendRC5(arr[i], 13);
                   delay(1000); 

            }
}

void loop()
{
}

In what way? Please post it.

Thank you for you response Sir !! :slight_smile:

It's smthg like this

01:42:30.978 -> Now sending
01:42:32.005 -> Now sending
01:42:33.035 -> Now sending
01:42:34.064 -> Now sending
01:42:35.093 -> Now sending
01:42:36.123 -> Now sending
01:42:37.155 -> Now sending
01:42:38.186 -> Now sending
01:42:39.222 -> Now sending


My programming skills are too poor lol, but i'm expecting to monitor at every seconds which signals is been sent , probably i need to run the code on a known working list of signals on my TV , before, to see how it works

Yes, it looks fine. You implied that something was wrong with it? What is it?

Well i just want to make sure that the loop over the Array elements is working correctly, but the Serial.print line output doesn't seems like i expected

I mean i was expecting smthg like this :
01:42:30.978 -> Now sending 0x100C
01:42:32.005 -> Now sending 0x1801

It's because you do this every time through the for loop.

1 Like

This is not legitimate. An unsigned char holds 8 bits. You are trying to stuff 16 bits into it.

Edit - my "spidey sense" tells me you don't really know C.

1 Like

Yes my Bad ! i just wanted to initialize the array ( i saw on another code that it's mandatory)

Then could you please advise how the declaration of the array can be done with such type of data (hex) ?

Illegal. You can pass a string or an unsigned char or other type, but not both.

1 Like

'unsigned int arr[] = ...'

Thank you Mr Aargh, sorry for making you answering about some basics of programmation !! will try this immediately

I can't hide this lol, i'm a doctor i never wrote a code in my life XD ! and i apprciate really that everytime i come here i found some helps lol

"dammit, Jim, I'm a doctor, not a..." :slight_smile:

1 Like

alright XD ! i don't know if you can suggest to me a simple code that can do the stuff, else i need really to go back and improve my programming skills , in both of cases i would like to thank you very much for your time

Unfortunately I haven't played with IR so long that the library has changed too much and I barely remember any of the functions.

I could help cobble around a "one working line" that is proven to send what you want it to send... in other words, help with the generic C and logic.

Is there any reliable example that comes close to what you want to do, after you have found the code?

There are some other people here that are more up to date on the IR library...

Yess you're right ! the idea come in my mind since 2 min, i have other devices using RC5 i think, i will need to collect some signals of their remote controls and see how the code will respond (something a little bit slow but it suits my level of coding/electronic :stuck_out_tongue: )

1 Like

In what format, text file? Or?

I see no worries, i will wait until tomorrow, other wise i searched too long on internet and didn't find something like this (bruteforcing signals to replace a lost remote controls, all of what i found is a reproduction for a known remote control signals)

As consumers, we should never have let this happen. So many huge expensive devices must have gone to landfill because of a missing $5 remote.

1 Like

i went here
https://lirc.sourceforge.net/remotes/philips/

and parsed all the links of the different philips like remote controls , ended with a list of 2000 Hex values