Tilt sensor

Hye. i has do a project that used arduino and tilt sensor. i want to ask, how can i set the time that everytime tilt trigger, the time will be display on lcd. and my project is used xbee which there will be two xbee dh will act as transmitter and receiver. so the lcd will be attach at the xbee receiver. so the output will display the time when the sensor is detect the vibration

How will you be interfacing between the Arduino and the LCD? Direct cable or I2C?

If you want to use X-Bee modules without much setting up, you could use 2 Arduinos, one either end of the wireless link, and send data from one to the other using plain serial.

i used direct cabling arduino and xbee…i used 2 arduinos for this project…but i had problem to communicate the both arduino…
how can i write the code to communicate both…
this is the code for transmitter
#include <LiquidCrystal.h>

#define Tilt 2
#define Xbee 1
int val;
char alertmsg;

void setup()
{
pinMode(Tilt, INPUT);
pinMode(Xbee, OUTPUT);
Serial.begin(9600);

}

void loop()
{
while(1)
{

if(digitalRead(Tilt) == 0)
{
digitalWrite(Xbee,LOW);
alertmsg = Serial.print(“No intruder detect”);
}
else
{
digitalWrite(Xbee,HIGH);
delay(1000);
alertmsg = Serial.print(“Intruder detected!!”);
delay(1000);

}
delay(1000);
}
}

and this code for receiver
#include <LiquidCrystal.h>

LiquidCrystal lcd (7,8,9,10,11,12);

#define Xbee 0
#define xbee 1
#define buzz 4
void setup()
{
pinMode(Xbee, INPUT);
pinMode(buzz, OUTPUT);
Serial.begin(9600);
lcd.begin(16,2);
lcd.print("");

}

void loop()
{
if (digitalRead (Xbee)==0)
{
digitalWrite(buzz, LOW);
lcd.setCursor(0,1);
delay(1000);
}
else
{
digitalWrite(buzz, HIGH);
lcd.setCursor(0,1);
delay(1000);
}
}

i did not know how to communicate it