Ahhh ok - so something more like this:
#include <SPI.h>
#include <EEPROM.h>
#include <RF24.h>
#include <Sensor.h>
#include <Time.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
Sensor gw;
#define CHILD_ID 1
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); // Set the LCD I2C address
float temp = 0; //for storing temperature values
float hum = 0; //for storing humidity values
void setup()
{
gw.begin();
// Send the sketch version information to the gateway and Controller
gw.sendSketchInfo("LCD", "1.0");
// Register any sensortype. This example we just create a motion sensor.
gw.sendSensorPresentation(CHILD_ID, S_MOTION);
lcd.begin(16,2); //Specify LCD size
lcd.backlight();
}
void loop()
{
message_s message = gw.waitForMessage(); //wait for a message to process
//check the type of message it is - temperature, humidity, etc. as per Variable Types defined in http://www.mysensors.org/build/sensor_api
if (message.header.type == 0){
temp = atof(message.data); //if it's a temp type, get the data and convert it to float
}
else if (message.header.type == 1){
hum = atof(message.data); //if it's a humidity type, get the data and convert it to float
}
else {
Serial.print("Unknow Message Type");
}
//serial prints for troubleshooting
Serial.print("Temp: ");
Serial.println(temp);
Serial.print("Hum: ");
Serial.println(hum);
UpdateLCD();
Serial.println("Waiting");
}
void UpdateLCD() { //LCD output
lcd.clear();
lcd.print("Temp:");
lcd.print(temp,1);
lcd.print("C");
lcd.setCursor(0,1);
lcd.print("Humi:");
lcd.print(hum,1);
lcd.print("%");
}