It sounds like you don't have enough current going through the IR LED. How are you driving it?
If you've said, I don't remember, but what Arduino are you using? And when you compile this, what does it say about the amount of flash and ram used?
You might try changing from this:
Serial.println("the command is" + command);
if (command==0);
IrSender.sendRaw(ch0, sizeof(ch0) / sizeof(ch0[0]), NEC_KHZ); // Note the approach used to automatically calculate the size of the array.
Serial.println("0");
to this:
Serial.print("the command is "); Serial.println(command);
if (command==0); {
IrSender.sendRaw(ch0, sizeof(ch0) / sizeof(ch0[0]), NEC_KHZ); // Note the approach used to automatically calculate the size of the array.
Serial.println("0");
}
[...and the same for the other nine ifs]
At least that's the way I would do it. But I'm not the greatest C++ coder.
I can't find the example you are using that this code came from. I've downloaded, but not installed, v4.3.1, but the SendRawDemo there isn't the same as yours. Can you point me to where your code comes from?
I will see if I can identify what protocol this is. Or maybe someone else will recognize it.
3350, 3347, 841, 2530, 840, 2531, 839, 839,
840, 2530, 839, 2530, 841, 2529, 840, 839,
841, 838, 841, 2529, 841, 2529, 840, 839,
840, 839, 840, 839, 841, 2530, 840, 839,
840, 838, 841, 838, 841, 2530, 840, 2529,
840, 839, 841, 839, 839, 2531, 839, 37461,
3350, 3350, 840, 2529, 840, 2529, 841, 839,
840, 2531, 839, 2529, 841, 2529, 840, 839,
840, 839, 841, 2529, 841, 2529, 840, 839,
840, 839, 841, 838, 841, 2529, 841, 838,
841, 838, 841, 838, 841, 2529, 840, 2530,
840, 838, 842, 838, 841, 2529, 840