//Inboxes
#define INBOX 0
#define OUTBOX 1
task main(){
string request;
string status;
while(1){
ReceiveMessage(INBOX, true, request);//Recieve message true will remove the message from the nxt mailbox
if(StrLen(request)>0){ //A mesage was recieved
//place the input as a response in the OUTBOX mailbox
//Notice that this is stored on the NXT in a mailbox untill read by the PC
//- so make sure the PC removes the response
SendResponseString(OUTBOX,request);
TextOut(0,LCD_LINE1,request,true);
request="";//empty request
}
}
}