i need help with this when ever i try to debug this with any of the 3 remotes i have at my use i get the same reply like for example i get 0 when i just press the button and i get 2730 when i hold the button, i even have inclued a screen, and for the code i switched the debug to 2 cuz 0 gave me problems
hmmm… I’m not really into this kind of thing, but my guess is that the Arduino only detects the signal as a real signal, not just noise, when it receives a continuous flow of data. You might try reviewing the code, but it looks like you’ve already done that. Maybe try hooking up a trimpot to adjust the signal?
The example code above is for a Sony IR remote, which uses the SIRCS-12 protocol. There are so many different IR protocols around (Philips RC5, RC6…), so it is difficult to say what IR remote uses what protocol, and of cause you need a different program for each protocol on your Arduino. Even Sony uses 3 different kind of SIRCS protocols, SIRCS-12, SIRCS-15 and SIRCS-20, so if you have an original Sony remote, you even don’t know which Sony protocol it uses.
Do you have an IR receiver with the correct frequency? Sony uses 40kHz. Philips RC5, RC6 protocol uses 36kHz. A 38kHz receiver maybe work for both frequencies.
Here is a very good side, showing all different IR protocols.
I bought one for $5 and it I bought one for $5 and it works with the IR sensor sold at tech-supplies.co.uk. They sell the sensor remote combo for somewhere around $40 I got it for $6 with the sensor and the remote I bought. The only hard part is hooking up the sensor and cyling through the codes to find the ones that work easily.