accelerometer give bad reading when VirtualWire is on.

okay so i have one of those mesmic accelerometers and when testing it with the arduino sample code it works fine,
then i only thing i have changed is mapped the values it gives me to 0-255 as you will see in the code,
then i want to send that through my RF links
and the sending works all my wiring is correct but when i start my Serial to debug , i get a reading of -188 when it should be 0 or close to it,
and when i comment out the virtual wire code , i get good readings. So i thought maybe it had something to do with having serial running at 9600 and virtualwire doing its thing at 2000 buad rate , so i commented out my serial.begin statement and compiled and went ahead and got my other arduino with the reciever and i still go the -188 values…
oh and ive loaded the values into an array since virtualwire sends strings
but that part of the code all works fine because if i print the values in the array they are acurate its just when i have VW on that i get it wrong

const int xPin = 2;		// X output of the accelerometer
const int yPin = 3;		// Y output of the accelerometer

#include <VirtualWire.h>
int coordinates[2];                 //must make an array to send intergers through virtualwire
void setup() {
  // initialize serial communications:
  Serial.begin(9600);
  //vw_set_ptt_inverted(true); // if i uncomment this and the following line my readings are off , way off. and i do not understand why
 // vw_setup(2000);
  // initialize the pins connected to the accelerometer
  // as inputs:
  pinMode(xPin, INPUT);
  pinMode(yPin, INPUT);
  
}

void loop() {
  
  
  // variables to read the pulse widths:
  int pulseX, pulseY;
  // variables to contain the resulting accelerations
  int accelerationX, accelerationY;
  
  // read pulse from x- and y-axes:
  pulseX = pulseIn(xPin,HIGH);  
  pulseY = pulseIn(yPin,HIGH);
  
 
  accelerationX = ((pulseX / 10) - 500) * 8;
  accelerationY = ((pulseY / 10) - 500) * 8;
  
   accelerationX = map(accelerationX,0 ,1050,0,255);
   accelerationY = map( accelerationY,0,1050,0,255);
 
 
   coordinates[0] = accelerationX;
 
  coordinates[1] = accelerationY;
 Serial.println(coordinates[0]);   // up to this point everything works fine and i get good readings but if i were to uncomment anything 
                                   //initializing virtualwire then my readings are off.. 
 //vw_send( (uint8_t *)coordinates, sizeof(coordinates));
// vw_wait_tx();
  delay(100);
  
  
  
 
 
 
}

okay well i did a little workaround i guess even though it still wont give me as accurate readings as it does without virtualWire enabled
its close enough with an average of -2 when i other wise get a 0 without VW activated.

all i did was move the 2 lines to the bottom and acitvated VW AFTER getting my readings and then drop the baud rate of VW back to 0 before the loop runs again so it does not
mess up my readings. I would use a deactivate function but i dont see one in the VW documentation so setting the baud rate to 0 will do.

void loop() {
  
  
  // variables to read the pulse widths:
  int pulseX, pulseY;
  // variables to contain the resulting accelerations
  int accelerationX, accelerationY;
  
  // read pulse from x- and y-axes:
  pulseX = pulseIn(xPin,HIGH);  
  pulseY = pulseIn(yPin,HIGH);
  
 
  accelerationX = ((pulseX / 10) - 500) * 8;
  accelerationY = ((pulseY / 10) - 500) * 8;
  
   accelerationX = map(accelerationX,0 ,1023,0,255);
   accelerationY = map( accelerationY,0,1023,0,255);

 
   coordinates[0] = accelerationX;
 
  coordinates[1] = accelerationY;
// Serial.println(coordinates[0]);   // up to this point everything works fine and i get good readings but if i were to uncomment anything 
                                   //initializing virtualwire then my readings are off.. 
 
 vw_set_ptt_inverted(true);  //this i would normally put it in the setup function but since it was causing problems it is here now
 vw_setup(2000);
 vw_send( (uint8_t *)coordinates, sizeof(coordinates));
 vw_wait_tx();
  delay(50);
   vw_setup(0); // and since  i cannot find a "deactivate" function for virtualwires transmitting end then this will have to do the trick. 
  
  
  
 
 
 
}