Constructor, Destructor or Type Conversion.

So, I amended part of my sketch and ended up with an error report related to the command wire.begin() in setup().
I guess it has something to do with my function to update the RTC but what? I can’t see any difference with the amended code cpmpared to the original code.

The error report is 'expected constructor, destructor or type conversion before ‘;’ token on the ‘wire.begin()’ command.

What is a constructor, destructor or type conversion?

I can’t get all the code on one post so the second part follows.

#include <Wire.h>
#include<LiquidCrystal_I2C.h>
#include <OneWire.h>
#include <DHT.h>
#include <BH1750.h>
BH1750 lightMeter;
#define DS1307_ADDRESS 0x68
#define BACKLIGHT_PIN 3
#define DHTPIN 4
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);


// DS18S20 Temperature chip i/o
  OneWire ds(10);  // on pin 10
LiquidCrystal_I2C lcd(0x3F,2,1,0,4,5,6,7); // 0x3F is the LCD address

byte date;
byte day=0;

byte hour;
byte h;
byte minute;
byte month;
byte No=7;


 
byte Reset=6;
byte RS=0;
byte second;
byte year=14;
byte Yes=8;
byte zero=0x00;  //Workround for issue #527


//SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS

void setup(){
  
Wire.begin();      

lcd.begin(20,4);

Serial.begin(9600);

dht.begin();

lightMeter.begin();

lcd.setBacklightPin(BACKLIGHT_PIN,POSITIVE);

lcd.setBacklight(HIGH);

pinMode(2,OUTPUT); //Heat

pinMode(6,INPUT);  //reset

pinMode(7,INPUT);  //the no switch

pinMode(8,INPUT);  //the yes switch

pinMode(13,OUTPUT); //Rain

}  

//End Setup

//LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL

void loop(){
  
   if(digitalRead(Reset)==HIGH)timerReset(); 
   
   displayTime();
   
   heating();
   
   humidity();
   
   //displayTime();   //only necessary if accurate seconds display is needed
   
   light();
   
   atmosphere();
   
}
// Emd of loop

//BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB

timerReset(){
   
    lcd.setCursor(0,2);
    
       lcd.clear();
          
              lcd.print(" Change Date/Time?");
              
                  lcd.setCursor(0,3);
                  
                      lcd.print("No               Yes"); 
                      
   wait=millis();                  
    
   while (digitalRead(Yes)==LOW &&(digitalRead(No)==LOW){  //wait 5 seconds for switch press
    
      n=digitalRead(No);
      
         if((millis()-wait>5000 || n==HIGH)return;
         
         }
     
   RS=1;
   
   resetTimer();

        }

   // end of timerReset

timerReset () doesn't have a type.

(it's "void" BTW)

#include <Wire.h>
#include<LiquidCrystal_I2C.h>
#include <OneWire.h>
#include <DHT.h>
#include <BH1750.h>

Consistency is good. ALWAYS use a space after the include statement, before the file name,

  if(digitalRead(Reset)==HIGH)timerReset();

ONE statement per line!

timerReset(){
   
    lcd.setCursor(0,2);
   
       lcd.clear();
         
              lcd.print(" Change Date/Time?");
             
                  lcd.setCursor(0,3);

Drinking
and
coding
is
a
bad
idea.

Use Tools + Auto Format so your drinking problem is hidden better.

I can’t get all the code on one post so the second part follows.

You could have, by attaching it. The stickies at the top of forum explain how.

  pinMode(6,INPUT);  //reset
  pinMode(7,INPUT);  //the no switch 
  pinMode(8,INPUT);  //the yes switch

You gave all those pins names, so why not use them?

    n=digitalRead(No);

I can't see where "n" is defined.

OK, AWOL. Just as I was about to post part two (which looks like it may extend to part three!) !!!

I used to know what that meant but it has left me. Remind me please what a type is.

void timerReset ()
{

How on earth did I miss that AWOL! Thanks a bunch.

The next problem is with the conversion of decimal to binary. I have been advised by Septillion to make my fragments compile-able but this takes a long time with this sketch because it's big and I'm slow.
If I just show the relevant fragment perhaps someone might see an error.

The error report details objects to the first conversion (second) but I expect it won't like any of them.

  case 6: //reset RTC
 
    Wire.beginTransmission(DS1307_ADDRESS);  //this is okay
    
      Wire.write(zero);
      
        Wire.write (decToBcd(second));
        
          Wire.write (decToBcd(minute));
          
            Wire.write (decToBcd(hour));
            
              Wire.write (decToBcd(day));
              
                Wire.write (decToBcd(date));
                
                  Wire.write (decToBcd(month));
                  
                    Wire.write (decToBcd(year));
                    
                      Wire.write(zero);
                      
                        Wire.endTransmission();
                        


      byte decToBcd(byte val){
       return((val/10*16)+(val%10));
        }
        
      byte bcdToDec(byte val){
       return ((val/16*10)+(val%16));
        }
        
    break;

The error report details

I'm not sure I can see an error report

      byte decToBcd(byte val){
       return((val/10*16)+(val%10));
        }
       
      byte bcdToDec(byte val){
       return ((val/16*10)+(val%16));
        }
       
    break;

You can't define functions INSIDE of other functions.