DS1307 - How to?

Hello, i'm new to arduino and while searching i found a code that fitted my needs, it only needed a few changes.

the pourpuse is to log the time and date that a door is opened.

i've made some changes but i haven't made the log part yet, however, my problem is other.

here's the error message

"tabaco2:7: error: 'RTC_DS1307' does not name a type
tabaco2.ino: In function 'void setup()':
tabaco2:15: error: 'RTC' was not declared in this scope
tabaco2.ino: In function 'void loop()':
tabaco2:86: error: 'DateTime' was not declared in this scope
tabaco2:86: error: expected `;' before 'now'
tabaco2:92: error: 'now' was not declared in this scope"

i've the RTClib installed.

here's my code

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


LiquidCrystal lcd(12,11,10,9,8,7);
RTC_DS1307 RTC;

const int hall_sensor = 4;
const int led = 13;
const int piez = 6;
const int override = 2;

void setup(){
  RTC.begin();
  Wire.begin();
  lcd.begin(16, 2);

  //  RTC.adjust(DateTime(__DATE__, __TIME__)); 

  
  pinMode(hall_sensor, INPUT);  
  pinMode(led, OUTPUT);  
  pinMode(piez, OUTPUT);
  pinMode(override, INPUT);
  lcd.setCursor(0,0);
  lcd.print("   A  INICIAR   ");
  lcd.setCursor(0,1);
  lcd.print("     ESPERE     ");
  delay(5000); //Give the hall_sensor time to calibrate
  lcd.clear();
  lcd.setCursor(0,0);
  lcd.print(" SISTEMA ACTIVO ");
  delay(2000);
}

void indicator_hall_sensor(){
  digitalWrite(led, HIGH);
  tone(piez, 300);
  delay(1000);
  digitalWrite(led, LOW);
  delay(1000);
}

void key(){
//delay(2500);  
  int override  = digitalRead(2);
  //delay(2500);
  if (override == HIGH){
    lcd.clear();
    lcd.setCursor(0,0);
    lcd.print(" CHAVE   ACEITE ");
delay(2500);  
}
  else{}
  }

  void trip_hall_sensor(){ 
    delay(5000);
    int override  = digitalRead(2);
    delay(2500);
    if (override == HIGH){
      key();  
    }

    else if (override == LOW){
      lcd.clear();
      lcd.setCursor(0,0);
      lcd.print("INICIAR  REGISTO");
      indicator_hall_sensor();
    }

  }
void loop(){
  int override = digitalRead(2);
  int hall_sensor = digitalRead(4);
  if ( hall_sensor == HIGH){

    //delay(10000);
    trip_hall_sensor();
  }

  else
    digitalWrite(led, LOW);
  noTone(piez);
  DateTime now = RTC.now();

lcd.clear();
  lcd.setCursor(0,0);
    lcd.print(" SISTEMA ACTIVO ");
      lcd.setCursor(0,1);
    lcd.print(now.hour(),DEC);
  lcd.print(':');
  lcd.print(now.minute(), DEC);
  lcd.print(':');
  lcd.print(now.second(), DEC);
  digitalWrite(led, HIGH);
  delay(200);
  digitalWrite(led, LOW);
  delay(200);
}

Looks to me like you didn't download the RTCLib library, you didn't install it in the right place, or you didn't restart the IDE after installing the library.

this is what i downloaded and installed

i've tryed trough the IDE and by copying the folder....

thanks

now i get this:

"In file included from tabaco2.ino:1:
C:\Program Files (x86)\Arduino\libraries\RTClib/RTClib.h:10: error: expected )' before 't' C:\Program Files (x86)\Arduino\libraries\RTClib/RTClib.h:11: error: expected )' before 'year'
C:\Program Files (x86)\Arduino\libraries\RTClib/RTClib.h:14: error: 'uint16_t' does not name a type
C:\Program Files (x86)\Arduino\libraries\RTClib/RTClib.h:15: error: 'uint8_t' does not name a type
C:\Program Files (x86)\Arduino\libraries\RTClib/RTClib.h:16: error: 'uint8_t' does not name a type
C:\Program Files (x86)\Arduino\libraries\RTClib/RTClib.h:17: error: 'uint8_t' does not name a type
C:\Program Files (x86)\Arduino\libraries\RTClib/RTClib.h:18: error: 'uint8_t' does not name a type
C:\Program Files (x86)\Arduino\libraries\RTClib/RTClib.h:19: error: 'uint8_t' does not name a type
C:\Program Files (x86)\Arduino\libraries\RTClib/RTClib.h:20: error: 'uint8_t' does not name a type
C:\Program Files (x86)\Arduino\libraries\RTClib/RTClib.h:25: error: 'uint32_t' does not name a type
C:\Program Files (x86)\Arduino\libraries\RTClib/RTClib.h:28: error: 'uint8_t' does not name a type
C:\Program Files (x86)\Arduino\libraries\RTClib/RTClib.h:34: error: 'uint8_t' does not name a type
C:\Program Files (x86)\Arduino\libraries\RTClib/RTClib.h:36: error: 'uint8_t' does not name a type
tabaco2.ino: In function 'void setup()':
tabaco2:15: error: 'class RTC_DS1307' has no member named 'begin'
tabaco2.ino: In function 'void loop()':
tabaco2:92: error: 'class DateTime' has no member named 'hour'
tabaco2:94: error: 'class DateTime' has no member named 'minute'
tabaco2:96: error: 'class DateTime' has no member named 'second'"

could it be that the library itself is currupted?

thanks

I don't think the library is properly installed.

Down load the zip version from GitHub--button on lower right of web page. Uncompress the downloaded folder. Move the uncompressed folder to the Arduino libraries folder.

Add the RTC library folder via the import library/add library of the sketch program window. Restart and it should show up as a contributed library.

I've messed up a few library installs myself so I speak from experience.

it's working now, done the install a few times, always the same procedure until it worked

thanks guys