Problems with Library IR Remote

Hello,

I’ve a problem with my code:

/*
  Example for different sending methods
  
  http://code.google.com/p/rc-switch/
  
*/
#include <RCSwitch.h>
#include <IRremote.h>

RCSwitch mySwitch = RCSwitch();
IRrecv irrecv(5);
decode_results results;

void setup() {

 
Serial.begin(9600);
 
irrecv.enableIRIn(); 

mySwitch.enableTransmit(6);
mySwitch.setProtocol(2);
  
}

void loop() {

mySwitch.send(543692032, 32); //Light on
delay(3000);
mySwitch.send(677909760, 32); //Light off
delay(3000);
  
}

Why this code doesn’t work with irrecv.enableIRIn() and work without ?
Any Idea ?

ps:sorry for my bad english, i’m french :confused:

After looking at both libraries, I can't see any immediate reason why 'irrecv.enableIRIn()' should stop 'RCSwitch' from working. If you comment out 'irrecv.enableIRIn();', 'RCSwitch' starts working again?

I'll be interested to hear the resolution to this too.

Edit: I just noticed that you've double-posted this topic. That's not a good way to get answers on these forums. You're only allowed to start one thread on any given problem. Problems with Library IR Remote

Thanks for your response !

Yes when i comment out 'irrecv.enableIRin', RCswitch starts. There is this problem only with protocol 2, not for the protocol 1.

Have you read the library docs?

https://github.com/sui77/rc-switch/wiki

I try but yes, Why ? For timers ?

Thanks

CharlyRaclett: Thanks for your response !

Yes when i comment out 'irrecv.enableIRin', RCswitch starts. There is this problem only with protocol 2, not for the protocol 1.

I'm afraid I'm not familiar enough with RCSwitch to know the difference between the two protocols. (I've never used RCSwitch at all.)

I just mainly checked the 'RCSwitch' library's *.h and *.cpp files earlier to see if there was a timer or interrupt conflict, but interrupts aren't enabled in 'enableTransmit()', only in 'enableReceive()', and transmit timing is done using 'delayMicroseconds()', not using a timer. Hopefully someone with direct experience using RCSwitch with IRremote in receive mode will see what's wrong. :)

The Wiki isn't particularly helpful, at least not what little of it I read.

Thanks for your time !

I hope i will have help...

CharlyRaclett: Thanks for your time !

I hope i will have help...

Good luck. :)

As a final check before going to bed, (it’s after midnight here), I just checked the IRremote library issues list on Github, and there are no issues reported relating to conflicts with RCSwitch.

Also just checked the RCSwitch issues list on Github too. Same result. It’s a bit of a mystery.

Thanks a lot ! Goodnight...

I'm lost...