I want to thank everyone for the time invested in this thread, you've been nice, fast and helpful and I'm really glad that I decided to use the forum.
I redid most of the code and I think the biggest problem I had was not declaring DHT object properly.
Everything seems to work fine for now.
[#include <dht.h>
#include <LiquidCrystal.h>
#include <Time.h>
#include <Wire.h>
#include <DS1307RTC.h>
#define lcd LiquidCrystal
dht DHT;
int DHT11_PIN = 2;
int RSPin = 6;
int EnablePin = 7;
int DS4 = 9;
int DS5 = 10;
int DS6 = 11;
int DS7 = 12;
int LCDColumns = 16;
int LCDRows = 2;
LiquidCrystal lcd(RSPin, EnablePin, DS4, DS5, DS6, DS7);
long interval = 3600000;
long LastCheck =0;
void setup ()
{
lcd.begin(LCDColumns, LCDRows); //Configure the LCD
setSyncProvider(RTC.get); //Declare RTC as time data source
}
void loop()
{
digitalClockDisplay();
DHTsensor();
}
void digitalClockDisplay () {
lcd.setCursor(0, 0);
lcd.print(hour());
lcd.print(":");
lcd.print(minute());
lcd.setCursor(6, 0);
lcd.print(day());
lcd.print(".");
lcd.print(month());
lcd.print(".");
lcd.print(year());
}
void DHTsensor () {
lcd.setCursor(0, 1);
lcd.print("H:");
lcd.setCursor(9, 1);
lcd.print("T:");
int Sensor = DHT.read11(DHT11_PIN);
unsigned long CurrentTime = millis();
if (CurrentTime - LastCheck >= interval) {
LastCheck = CurrentTime;
lcd.setCursor(2,1);
lcd.print(DHT.humidity, 1);
lcd.setCursor(11,1);
lcd.print(DHT.temperature, 1);
}
}