Need help with code for WEATHER SESTEM

Hello all I am new to programming with arduino and everything else, but I have been running this code and i got it to work the first time and now I dont know why it wont work.

Also while attempting to add a rtc I do not know how to do it. I am using a sainsmart tiny RTC ds1307. And for the weather project i am using a 16x2 lcd, dht11 sensor, and a arduino uno.

It says stuff like "dht11 does not name a type", or "RTC was not declared in this scope". Not sure what to do.

Heres the code:

#include <dht.h>
#include <Wire.h>
#include <LiquidCrystal.h>
#include <Time.h>
#include <RTClib.h>


const char* Mon[] =
{"Dec", "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov" }; //months of the week also in romanian

byte thermometer[8] = //icon for termometer
{
    B00100,
    B01010,
    B01010,
    B01110,
    B01110,
    B11111,
    B11111,
    B01110
};

byte drop[8] = //icon for water droplet
{
    B00100,
    B00100,
    B01010,
    B01010,
    B10001,
    B10001,
    B10001,
    B01110,
};

/*-----( Declare objects )-----*/

// Set the pins on the I2C chip used for LCD connections:
//                    addr, en,rw,rs,d4,d5,d6,d7,bl,blpol
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
 // Set the LCD I2C address

dht11 DHT11;

/*-----( Declare Constants, Pin Numbers )-----*/
#define DHT11PIN 2 //dht11 signal pin connected to D2

void setup()   /*----( SETUP: RUNS ONCE )----*/
{
  Wire.begin();
  lcd.begin(16,2);         // initialize the lcd for 16 chars 2 lines, turn on backlight
  //lcd.backlight();
  lcd.clear();
  lcd.createChar(1,thermometer);
  lcd.createChar(2,drop);
  
   // part code from http://tronixstuff.wordpress.com/
Wire.beginTransmission(0x68);
Wire.write(0x07); // move pointer to SQW address
Wire.write(0x10); // sends 0x10 (hex) 00010000 (binary) to control register - turns on square wave
Wire.endTransmission();
// end part code from http://tronixstuff.wordpress.com/

setSyncProvider(RTC.get);
  
  
}/*--(end setup )---*/

void loop()   /*----( LOOP: RUNS CONSTANTLY )----*/
{
   temp_check(); //displaying temperature
   date_time(); //displaying date and time
}
void temp_check()
{
  int chk = DHT11.read(DHT11PIN);
  lcd.setCursor(0, 1);
  lcd.write(1);
  lcd.write(" ");
  lcd.print((float)DHT11.temperature*1.8+32, 0);
  lcd.print((char)223); //degree sign
  lcd.print("F");
  lcd.print(" ");
   
  lcd.setCursor(9, 1);
  lcd.write(2);
  lcd.setCursor(11, 1);
  lcd.print((float)DHT11.humidity, 0);
  lcd.print("%");
  delay(2000);

}


void date_time()
{

  tmElements_t tm;
  (RTC.read(tm));

  lcd.setCursor(0, 0);
  addzero(tm.Hour);
  lcd.print(":");
  addzero(tm.Minute);
  lcd.setCursor(7,0);
  lcd.print(tm.Month[Mon]);
  lcd.print(" ");
  addzero(tm.Day);
  lcd.print("-");
  lcd.print(tmYearToCalendar(tm.Year)-2000);
}
void addzero(int number) { //this adds a 0 before single digit numbers
  if (number >= 0 && number < 10) {
    lcd.write('0');
  }
  lcd.print(number);
}

moderator: added code tags == # button above smileys. (please use them)

It says stuff like "dht11 does not name a type", or "RTC was not declared in this scope". Not sure what to do.

Well, most people would fix the problems.

If you don't know how, "stuff like" doesn't cut it. Post the EXACT error messages.

Typically, "does not name a type" means that you have not installed a library correctly.

Hi Paul,

Sorry for the lack of accuracy, I am new to this and have never posted on a forum before.

When I compile the code it gives me an error message that read " 'dht11' does not name a type".
Being a newbie I actually do not know how to fix this or what is wrong. That is why I am here.

Also while adding a RTC to the setup I think I was able to successfully program the time to the RTC module but when I plug it into the setup for my temperature and humidity sensor it comes up on the lcd reading the default time and a data of "Nov 0".

I do not know if it is some thing in the code or my setup.

If you could please help me that would be really great.

This is where I got the inspiration for the project: http://www.instructables.com/id/Clock-with-termometer-using-Arduino-i2c-16x2-lcd-D/

Hope this helps

Eoinlane98:
'dht11' does not name a type"

To reiterate what PaulS said, this typically means you didn't install the library correctly, or you didn't restart the Arduino IDE since installing the library.

So far I have tried to reinstall the dht11 library and nothing has changed. Is it possible that the ide is not recognizing the library installed?

Eoinlane98:
Is it possible that the ide is not recognizing the library installed?

Only if it's not installed correctly or you haven't restarted the IDE since it was correctly installed.

So far I have tried to reinstall the dht11 library and nothing has changed. Is it possible that the ide is not recognizing the library installed?

It's more likely that the code you didn't post has problems.

There are a lot of circumspect "answers" here. What we need is the following:

  1. ALL THE CODE that you are using.
  2. Tell us WHERE you installed the dht11 library.
  3. Have you closed and reopened the Arduino IDE after installing the dht11 library?

From this beginning, we can drill down to more specifics.