what do these set of coding lines mean ? communication is done via zigbee .

while(1){
// lcd.begin(20,4);
// lcd.clear();
if (Serial.available()) {
int inByte = Serial.read();
lcd.setCursor(16,1);
lcd.write(inByte);

if(inByte=='m'){
lcd.clear();lcd.setCursor(0,0);
lcd.print("sending data");
delay(1000);

senddata();}

Every one of those method calls is documented. It is worth you spending the time to look them up.

PaulS:
Every one of those method calls is documented. It is worth you spending the time to look them up.

Not only are they documented, but the names of those functions pretty much spell out exactly what they do.

Having said that, while(1) is almost always a bad idea.

The basic problem here is that the OP simply doesn't know how to code at all and needs to do a C++ tutorial and to work through the Arduino examples.