Hello, i guess/hope this is a pretty simple problem, anyhow, i can't seem to get it figured out... :)
I'm trying to control a TV and a Receiver with the Arduino, by sending the IR signals the IR Remote normaly sends, the Receiver is NEC and that works fine, but the TV which is NC5 doesn't... I'm not quite sure what the problem is, but:
It's a quite an old and small TV (not flatscreen), from Mitsai (if that matters), and it's Remote send NC5 codes that alternate between 2 types of commands every time the button is repushed, and resends the same signal as long as the button is being pressed... So for example, if i press the Power button the remote sends 0xC, if i hold it, it sends it over and over again, if i release the button and press it again, it sends 0x80C and keeps on sending that as long as i hold the button pressed...
The dump IRrecvDump example of the IRremote library (from Ken Shirriff), gave me following for the Power button: C Decoded RC5: C (12 bits) Raw (24): -8798 900 -850 1800 -850 900 -850 950 -800 950 -850 900 -850 900 -850 950 -800 950 -1600 1050 -850 1800 -800 950
The commands (all i wrote down/all i need) are:
0xC || 0x80C - Power 0xD || 0x80D - Mute 0xA || 0x80A - Number 0 0x1 || 0x801 - Number 1 0x2 || 0x802 - Number 2 0x3 || 0x803 - Number 3 0x4 || 0x804 - Number 4 0x5 || 0x805 - Number 5 0x6 || 0x806 - Number 6 0x7 || 0x807 - Number 7 0x8 || 0x808 - Number 8 0x9 || 0x809 - Number 9
0x21 || 0x821 - Channel - 0x20 || 0x820 - Channel +
0x11 || 0x811 - Volume - 0x10 || 0x810 - Volume +
and i don't know if that is standart but, if you press the power button, for example and the remote sends a 0xC, and you then press the Mute button (this applies to all buttons), the remote sends 0x80D... So the remote alternates between codes with and without the 0x80, even when you use different buttons, and i'm guessing the TV probably has some kind of timeout where it accepts either one of the forms of a command as a "first press", but if it doesn't that would be rather unpractical because the arduino first of all would have to know what was the code was that was send to the tv (so you couldn't use the normal remote anymore), and when the arduino restarts, how does it know with which version of the command to start?!
Anyhow, my problem is (sorry for the long long explanation, just trying to explain my problem as precise as possible), i tried a irsend.sendNC5(0xC, 36); or irsend.sendSony(0x80C, 36); but no matter what command i send the TV always "thinks" i pressed Number 0, so apparently it does kind of recognize the code, but, not correctly... I never used NC5, maybe the code has to be send multiple times (like with the Sony TV) or something?!
So, bassically my question is, what am i doing wrong (sending the code)? And also, how would you go about alternating between commands with and without the 0x80? I guess i have a idea of how i would do it... Just define some boolean variable that always flips back and worth (every time the button would be released and pressed again) and then send the codes accordingly, but how can i just define the command and calculate/add the 0x80 to the command without having to define them both as command version 1 and 2?
Well, hope someone can give me a hand there... :)
Thank you very much, in advance! ;)
Many regards, Delphiño