RF transmitter working with LCD

Hi everyone,

I'm new to the forum and fairly new to Arduino. I'm looking for some advice on how to create a device which receives a signal from an RF transmitter and displays a message on an Arduino LCD when the receiver is within the range of the transmitter.

I've been trying to do it myself by following these instructions and using the VirtualWire library:

Unfortunately, I've been really struggling with adapting the code in order to display a message on the LCD when the transmission signal is received.

I've been using the following equipment so far:

2 x Arduino Uno

RF Transmitter & Receiver kit 433Mhz (http://www.ebay.co.uk/itm/131144682267?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1497.l2649)

LCD from the Arduino starter kit

If anyone has any advice on how I could adapt the code from the Instructables instructions in order to include the LCD it would be much appreciated as I'm really struggling! Or if anyone has any advice on a better way to do it, it would be much appreciated.

Thanks,

John

I think I've managed to figure it out, using this code for the transmitter:

#include <VirtualWire.h>
void setup(){
vw_setup(2000); // bps
}
void loop(){
send("hello_world"); //your message
delay(1000);
}
void send (char *message){
vw_send((uint8_t *)message, strlen(message));
vw_wait_tx();
}

And this code for the receiver:

#include <VirtualWire.h>
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 10, 5, 4, 3, 2);

byte message[VW_MAX_MESSAGE_LEN];
byte messageLength = VW_MAX_MESSAGE_LEN;
void setup(){
Serial.begin(9600);
Serial.println("Device is ready");
vw_setup(2000); //bps
vw_rx_start();
}
void loop(){
if (vw_get_message(message, &messageLength)){
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print("hello_world");
for (int i = 0; i < messageLength; i++){
Serial.write(message[ i ]);
}
Serial.println();
}
}

Now I just need to adjust the code so that the message disappears when the RF transmitter is out of range. If anyone has any advice for doing this it would be much appreciated.