Open hiduino opened 5 years ago
I concur with @hiduino. Until I found this post, I spent two days fighting what I thought was a hardware issue as my television was intermittently receiving codes I sent. My code is using the IRLibCombo send method with 3 paramters, the protocol, code, and number of bits as my device handles multiple protocols at the same time.
With the above bug, when the # of bits is supplied for an NEC code (32) it overrides the frequency to 32 khz instead of 38 khz. The result was that my television had a weak response to codes which sometimes were skipped altogether.
With the corrections above, my device now has complete reliability in transmitting codes.
The definition to pass the frequency from IRLibCombo.h send case statement is using 'khz' parameter.
public:
void send(uint8_t protocolNum, uint32_t data, uint16_t data2=0, uint8_t khz=38) {
if(khz==0)khz=38;
switch(protocolNum) {
IR_SEND_PROTOCOL_01
However, the IRLib_P01_NEC.h is using 'data2' which is passing the wrong parameter for frequency.
#define IR_SEND_PROTOCOL_01 case 1: if(data2==0)data2=38;IRsendNEC::send(data,data2); break;
This should be changed to:
#define IR_SEND_PROTOCOL_01 case 1: if(khz==0)khz=38;IRsendNEC::send(data,khz); break;