NC5 IR sending problems...

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

Have you tried simply sending the w/o 0x80 signal (so only 0xC etc) a couple of times directly after each other.
You could use a for loop to send it about 10 times, it shouldn’t bother the TV.

And when that doesn’t work, or only the one time, have a boolean like you said, that toggles when you send a command, that way you’ll always know which one to send.

Hey, thanks for the reply! Yeah, i thought that might work (if i just don't use the 0x80 thing), but to try that i would have to get the TV to "understand" my signals first, and not just take every signal i send as a "0"... So, you got any idea on what could be the reason for the TV always thinking i'm pressing the "0" button, when i use irsend.sendNC5(0xC, 36); ?