 // Store the pir states on interupt.
 volatile byte flags = 0;
 volatile byte motion = 0;
+
+volatile byte motionUp = 0;
+volatile byte motionDown = 0;
 
 /**
  * @see http://forum.arduino.cc/index.php/topic,85627.0.html

  digitalWrite(DEBUG_LED_TX, HIGH); // Flash a light to show transmitting
  
  // Send multiple times in the hope it gets through.
  for (byte i=0; i<4; i++) {
    vw_send((uint8_t *)buf, strlen(buf));
    vw_wait_tx(); // Wait until the whole message is gone
    delay(500);

     bitClear(flags, F_DOWN);
  }
  
  /*
  if (motion) {
    motionTime = currentMillis;
    
