Receiver reads message and prints on lcd screen?

Hello,
I want my receiver to receiver a signal command from my transmitter and print a message on the lcd screen. So just for an example i want my receiver to receive "hi" and print "Hello World" on the LCD screen? Any advice?

Transmitter Code:

// constants won't change. They're used here to
// set pin numbers:
const int buttonPin = 2;     // the number of the pushbutton pin
const int ledPin =  13;      // the number of the LED pin
#include <VirtualWire.h>

// variables will change:
int buttonState = 0;         // variable for reading the pushbutton status

void setup(){
  // Initialize the IO and ISR
  vw_setup(2000); // Bits per sec
  // initialize the LED pin as an output:
   pinMode(ledPin, OUTPUT);
  // initialize the pushbutton pin as an input:
  pinMode(buttonPin, INPUT);
}

void loop() {
  // read the state of the pushbutton value:
  buttonState = digitalRead(buttonPin);

  // check if the pushbutton is pressed.
  // if it is, the buttonState is HIGH:
  if (buttonState == HIGH) {
    // turn LED on:
    digitalWrite(ledPin, LOW);
    send("Away");
    delay(1000);
  } 
  else {
    // turn LED off:
    digitalWrite(ledPin, HIGH);
    send("Hi");
    delay(1000);
  }
}
void send (char *message)
{
vw_send((uint8_t *)message, strlen(message));
vw_wait_tx(); // Wait until the whole message is gone
}

Reciever Code:

SimpleReceive
This sketch displays text strings received using VirtualWire
Connect the Receiver data pin to Arduino pin 11
*/
#include <VirtualWire.h>
byte message[VW_MAX_MESSAGE_LEN]; // a buffer to store the incoming messages
byte messageLength = VW_MAX_MESSAGE_LEN; // the size of the message
void setup()
{
Serial.begin(9600);
Serial.println("Device is ready");
// Initialize the IO and ISR
vw_setup(2000); // Bits per sec
vw_rx_start(); // Start the receiver
}
void loop()
{
if (vw_get_message(message, &messageLength)) // Non-blocking
{
Serial.print("Received: ");
for (int i = 0; i < messageLength; i++)
{
Serial.write(message[i]);
}
Serial.println();
}
}

forum.arduino.cc/index.php?topic=377218.0

Yes but where in the code do i put it? i put it as an if statement in the void loop but it didnt work

If you don't have a transmitter, how do you expect to receive anything?

i do have a transmitter, thats why i put the transmitter code on my post

You have given no indication of were you are having a problem.

Are you able to read the received data?
Are you able to put words on the LCD?

What have you done to fault find?

Give us some help on where the problem might be.

Weedpharma

so far i am able to send a message on command and it prints on my computer screen the correct readings. But the problem is in putting the message onto the lcd screen. It only prints the 1st message, it doesn't recognize there's a change in the message.

After alot of editing this is my current code:

#include <LiquidCrystal.h>
#include <VirtualWire.h>
LiquidCrystal lcd(12, 8, 5, 4, 3, 2);
byte message[VW_MAX_MESSAGE_LEN]; // a buffer to store the incoming messages
byte messageLength = VW_MAX_MESSAGE_LEN; // the size of the message
void setup()
{
Serial.begin(9600);
Serial.println("Device is ready");
// Initialize the IO and ISR
vw_setup(2000); // Bits per sec
vw_rx_start(); // Start the receiver
lcd.begin(16, 2);
  // Print a message to the LCD.
}
void loop()

{
if (vw_get_message(message, &messageLength)) // Non-blocking
{
  switch(message[1])
{case 0:
      lcd.setCursor(0, 1);
      lcd.print("O.O");
      break;
case 1 :
      lcd.setCursor(0, 1);
      lcd.print("Hi! :)");
      break;
}
{
Serial.print("Received: ");
for (int i = 0; i < messageLength; i++)
{
Serial.write(message[i]);
}
Serial.println();
}}}

What are you transmitting? What is the "message"? What is element message[1]?
The transmitting code is important for us to determine your problem.

If you are sending chars, then message[1] is likely to be char '0' = 48 or char '1' = 49.

Try

 switch(message[1]-48)