VirtualWire and IRRemote library problem

Hey everyone,
I have been trying to combine the Virtualwire 1.5 and Ken Sherriff’s IRRemote (Panasonic code integrated) libraries.

I have an arduino with an RF receiver connected to Pin 11 and an IR LED connected to pin 3. When I try to run the following code, I receive the transmission, “Pana Sent” is printed in serial monitor, IR LED flashes but not the code to turn on my TV.
My hardware setup will run the VirtualWire receiver example and IRRemote sendPanasonic perfectly. All I have done is combine the two with little result.

#include <VirtualWire.h>
#include <IRremote.h>
#include <IRremoteInt.h>
IRsend irsend;

int ledPin = 3;

void setup(){
  pinMode(ledPin, OUTPUT);
  Serial.begin(9600);
  Serial.flush();

    vw_setup(2000);	 // Bits per sec
    vw_rx_start();       // Start the receiver PLL running
}

void loop() {
  irsend.sendPanasonic(0x40040100, 0xbcbd);
  Serial.println("Pana sent");
  delay(500);

    uint8_t buf[VW_MAX_MESSAGE_LEN];
    uint8_t buflen = VW_MAX_MESSAGE_LEN;

    if (vw_get_message(buf, &buflen)) // Non-blocking
    {
	int i;

        digitalWrite(13, true); // Flash a light to show received good message
	// Message with a good checksum received, dump it.
	Serial.print("Got: ");
	
	for (i = 0; i < buflen; i++)
	{
	    Serial.println(buf[i]);
	}
	Serial.println("");
        digitalWrite(13, false);
    }
}

However, the IR will send a working code (but no RF received) if I comment out this line

    vw_setup(2000);	 // Bits per sec

I would be grateful for any help or a push in the right direction

Did you ever figure this out? I've been trying to get NewSoftSerial and Ken's IR library to work together

Here's that topic: Arduino Forum

Sorry to bring back an old thread, but I am having exactly the same issue. I researched some and found that virtualwire uses timer 1 and irremote uses timer 2, so there shouldn't be an issue, unless irremote uses analogwrite, which I believe uses timer 1. If anyone has a modified version of the library or another solution please reply.

Thanks.

Hi I solved the problem! Perd must configure settings using Irremote vw_setup () to zero and then reinstall the desired value.
example:
vw_setup (0);
int long bits2 = atol (dat_in);
int long value2 = atol (ol_in);
irsend.sendNEC (bits2, value2);
Serial.println (bits2);
vw_setup (4000);
Peshenie prompted this article.
http://adatum.ru/2013/02/22/delaem-sistemu-umny-j-dom-na-arduino-chast-1/

hi friend
I am also having the same problem can you help me

#include <VirtualWire.h>
#include <IRremote.h>
#include <IRremoteInt.h>
IRsend irsend;

int pino = 11; //pin RX

int initPin = 3; //pin IR

int valor;

unsigned int soundDown[26] = {2350,650,1150,650,1150,600,600,600,600,600,1250,550,550,650,550,650,1150,650,550,650,550,600,600,600,600};


void setup()
{
    pinMode(initPin, OUTPUT);
      
    vw_set_rx_pin(pino);    // VirtualWire
    vw_set_ptt_inverted(true); 
    vw_setup(2000);	 
    vw_rx_start();  

       Serial.begin(9600);
}

void loop()
{
    uint8_t buf[VW_MAX_MESSAGE_LEN];
    uint8_t buflen = VW_MAX_MESSAGE_LEN;

    if (vw_get_message(buf, &buflen)) // Non-blocking
    {
	int i;
        
	for (i = 0; i < buflen; i++)
	{
	        
            valor = buf[i], HEX;      
            if(valor == 65){ 
            soundDown[26];}
	}
	
    }
}

Very Thanks

Sorry to bring back an old thread, but I am having a similar issue. There is a solution to the incompatibility of these two libraries? There is an alternate library in virtualwire?

void iRsend(){

noInterrupts(); // <------ Use this ----------

vw_rx_stop();
vw_setup(0);

delay(500);

lcd.setCursor(0, 3);
lcd.print(“Sending”);

unsigned int S_pwr[68]={4600,4350,700,1550,650,1550,650,1600,650,450,650,450,650,450,650,450,700,400,700,1550,650,1550,650,1600,650,450,650,450,650,450,700,450,650,450,650,450,650,1550,700,450,650,450,650,450,650,450,650,450,700,400,650,1600,650,450,650,1550,650,1600,650,1550,650,1550,700,1550,650,1550,650};
irsend.sendRaw(S_pwr, 68, 38); // Sony TV power code

delay(500);

irrecv.enableIRIn();
vw_rx_start();
interrupts(); // <------ And use this ----------To Fix Sending IR codes With receiving Virtual Wire!!!

}