sending infrared and rotating servo

Hello,

I want to rotate a servo and send IR codes at the same time, or first rotate a bit and then send a code.
It seems like the servo can't rotate if the IR led is sending. If i comment out the sending part, the servo works fine.

My goal for this project is to send IR and get RF back (if the IR is pointed in the right direction). I can send and receive everything, but i have to point the IR led by hand and i want to automate that process, therefore i tried using a servo.

I want to make the servo stop when i get a message back (that means that the other arduino received IR).

I tried detaching the servo before sending IR.

My latest iteration of the code:

#include <ServoTimer2.h>
#include <VirtualWire.h>
#include <IRremote.h>
IRsend irsend;
ServoTimer2 servo;

int gotRF=false;
int pos=0;
void setup()
{
  Serial.begin(9600);
  vw_set_ptt_inverted(true); // Required for DR3100
  vw_set_rx_pin(12);
  vw_setup(4000);  // Bits per sec
  pinMode(13, OUTPUT);

  vw_rx_start();       // Start the receiver PLL running
  servo.attach(5);
  
}
void loop()
{
  for (pos = 750; pos <= 2250; pos += 2) { // goes from 0 degrees to 180 degrees
    // in steps of 1 degree
    servo.write(pos);              // tell servo to go to position in variable 'pos'
    sendIR();
    lookforRF();
  }
  for (pos = 2250; pos >= 750; pos -= 2) { // goes from 180 degrees to 0 degrees
    servo.write(pos);              // tell servo to go to position in variable 'pos'
    sendIR();
    lookforRF();                   
  }
  
  
}
void sendIR(){
  irsend.sendSony(0x68B92, 20);
  delay(10);
}
void lookforRF(){
  uint8_t buf[VW_MAX_MESSAGE_LEN];
  uint8_t buflen = VW_MAX_MESSAGE_LEN;

  if (vw_get_message(buf, &buflen)) // Non-blocking
  {
    if (buf[0] == '1') {
      Serial.println("Got: 1");
      gotRF=true;
    }
  }
}

Does anybody know a way to rotate the servo and send IR codes?
Other suggestions for this project are also appreciated.

So you want the servo to turn and send data at the same time?

What attachment do you have to receive rf it's not in parts list? Also does your serial monitor show that you are receiving or sending anything?

I want to make the servo stop when i get a message back

To make a servo stop you have to give it a precisely train of pulses. As you have found you cant do that and send IR. This is because the libiary for both tasks uses the same hardware timers. Their are only three timers and ao you get this sort of clash, each libiary uses two timers.

So the only way to do this is to generate the servo pulses off board with an chip. Something like this.

Thanks all!
Grumpy_mike, that answers my question. I have to try something else.
I can maybe let another Arduino just send infrared all the time, as that does not have to interact to other readings.