SOLUCIONADO Apaga LCD y Enciende LCD a una hora determinada

Otra vez molestando
Vi un codigo que hace lo que que quiero pero no se como implementarlo en mi sketch para que funcione lo puse al final de mi sketch lo moví por todos lados y no di como hacerlo funcionar.
en teoría se apagará la iluminación a la 0 hrs y encendería alas 8 de la mañana
De ante mano gracias

http://forum.arduino.cc/index.php?topic=260397.15

void checkBkLgt() {
  int horaActual = hour()*60+minute();

  if(horaActual >  480)  // (8 * 60) + 0 = 480
  {
    lcd.backlight();
  }  
  else if(horaActual >=  0 && horaActual <=  480)  // (8 * 60) + 0 = 480
  {
    lcd.noBacklight();
  }  
}

mi sketch lo adjunto

DimmPrueCar.ino (7.02 KB)

Porque no usas TimeAlarms Library

mira el ejemplo, quita todas las horas que no te sirven.
Una enciende y otra apaga.
Cada hora que ves en el ejemplo hace 1 cosa 1 vez. No se repite.
Para tu caso seria asi

/*
 * TimeAlarmExample.ino
 *
 * This example calls alarm functions at 8:30 am and at 5:45 pm (17:45)
 * and simulates turning lights on at night and off in the morning
 * A weekly timer is set for Saturdays at 8:30:30
 *
 * A timer is called every 15 seconds
 * Another timer is called once only after 10 seconds
 *
 * At startup the time is set to Jan 1 2011  8:29 am
 */
 
#include <Time.h>
#include <TimeAlarms.h>

void setup()
{
  Serial.begin(9600);
  setTime(8,29,0,1,1,11); // set time to Saturday 8:29:00am Jan 1 2011
  // create the alarms 
  Alarm.alarmRepeat(8,30,0, ApagoLCD);  // 8:30am every day
  Alarm.alarmRepeat(17,45,0,EnciendoLCD);  // 5:45pm every day 
}

void  loop(){  
  digitalClockDisplay();
  Alarm.delay(1000); // wait one second between clock display
}

// functions to be called when an alarm triggers:
void ApagoLCD(){
  Serial.println("Alarm: - turn lights off");    
}

void EnciendoLCD(){
  lcd.backlight();
  Serial.println("Alarm: - LCD Encendido");           
}

void WeeklyAlarm(){
  Serial.println("Alarm: - LCD Apagado");      
}

void digitalClockDisplay()
{
  // digital clock display of the time
  Serial.print(hour());
  printDigits(minute());
  printDigits(second());
  Serial.println(); 
}

void printDigits(int digits)
{
  Serial.print(":");
  if(digits < 10)
    Serial.print('0');
  Serial.print(digits);
}

ok lo e probado en el ejemplo lo e dejado asi y funciona

#include <Wire.h>    
#include <Arduino.h>
#include <TimeLib.h>
#include <TimeAlarms.h>
#include <LiquidCrystal_I2C.h>       
LiquidCrystal_I2C lcd(0x3F, 16, 2); 
void setup()
{
  Serial.begin(9600);
  setTime(10,8,0,1,1,11); // Establece la hora y fecha 8:29:00am Jan 1 2011
  // Crea las alarmas 
  Alarm.alarmRepeat(10,10,0, ApagoLCD);  //  Prueba   // 23:00pm cada dia
  Alarm.alarmRepeat(10,12,0,EnciendoLCD);  //  Prueba     // 10:00am cada dia 
  Wire.begin();  
  lcd.begin();
}
void  loop()
{  
  digitalClockDisplay();
  Alarm.delay(1000); //espere un segundo entre la visualización del reloj
}
// funciones a llamar cuando se dispara una alarma:
void ApagoLCD(){
 lcd.noBacklight();
  Serial.println("Alarm: - LCD Apagado"); 
 }
void EnciendoLCD(){
  lcd.backlight();
  Serial.println("Alarm: - LCD Encendido");
 }
void digitalClockDisplay()
{
 }

pero cuando trato de ponerlo me reclama
expected primary-expression before ') token
en la line 32

#include <Wire.h>    
#include <Arduino.h>
#include <LiquidCrystal_I2C.h>       
LiquidCrystal_I2C lcd(0x3F, 16, 2);  
#include <OneWire.h>                     //temperatura
#include <DallasTemperature.h>           //temperatura 
#include "RTClib.h" 
#include <TimeLib.h>
#include <TimeAlarms.h>
RTC_DS1307 rtc;//RTC_DS3231 RTC;
#define ONE_WIRE_BUS 12                  //temperatura, pin de entrada
#define Pleds  4 //creamos la variable leds de 4 elementos **** prue1az4blan
int led[Pleds] = {6,9,10,11}; //creamos un vector para los pines a utilizar **** prue1az4blan
OneWire oneWire(ONE_WIRE_BUS);           //temperatura
DallasTemperature sensors(&oneWire);     //temperatura
float Celsius = 0;                       // car127 de esquema term lcd


void setup () { 
     Serial.begin(9600);           // Establece la velocidad de datos del puerto serie 
     Wire.begin();                 // Establece la velocidad de datos del bus I2C 
     sensors.begin();              //Temperatura
     rtc.begin();                  // Establece la velocidad de datos del RTC 
 // rtc.adjust(DateTime(__DATE__), (__TIME__));
 // rtc.adjust(DateTime(2017, 11, 24, 22, 12, 0));
     lcd.begin();
    while (!Serial); // for Leonardo/Micro/Zero
 
  
  // Crea las alarmas 
 setTime(10,8,0,1,1,11); // Establece la hora y fecha 8:29:00am Jan 1 2011
  Alarm.alarmRepeat(23,00,0, ApagoLCD);  // 23:00pm cada dia ApagoLCD
  Alarm.alarmRepeat(10,00,0, EnciendoLCD);  // 10:00am cada dia 
   } 

void loop () { 
  
    ///////  Apaga LCD y Enciende LCD /////////////  
 {
 digitalClockDisplay();
  Alarm.delay(1000); //espere un segundo entre la visualización del reloj
}
// funciones a llamar cuando se dispara una alarma:
void ApagoLCD(){
 lcd.noBacklight();
  Serial.println("Alarm: - LCD Apagado"); 
 }
void EnciendoLCD(){
  lcd.backlight();
  Serial.println("Alarm: - LCD Encendido");
 }
void digitalClockDisplay()
{
 }

  //int minute; 
 // int hour; 
  int tiempo; 
  
  DateTime now = rtc.now();            // Obtiene la fecha y hora del RTC 



// ahora mostrar fecha y hora
  lcd.clear(); 
  //lcd.backlight(); 
  lcd.setCursor(0,1);
  lcd.print("Hora:"); 
  lcd.print(" ");
  if (now.hour() < 10)              //  si hora es menor a 10 
 {                                   //  coloque un 0
  lcd.print("0");                    //       y
 }                                   //      se
 lcd.print(now.hour(), DEC);         //    leera 08
  lcd.print(":"); 
 if (now.minute() < 10)               
 {                                   
  lcd.print("0");                    
 }
  lcd.print(now.minute(), DEC);   
  lcd.setCursor(0,0); 
  lcd.print("Fecha:");
  lcd.print(""); 
  lcd.print(now.day(), DEC); 
  lcd.print("/"); 
  lcd.print(now.month(), DEC); 
  lcd.print("/"); 
  lcd.print(now.year(), DEC); 
   
       //  lcd.print("   "); 
  delay (3000);     // Pausa 3 segundos 
  //lcd.noBacklight(); 
 // delay (3000);   

tiempo=(now.hour()*60)+now.minute(); // Para que sea un numero entero lo medimos en minutos 

 if (tiempo < 60)  
  {  
   tiempo=tiempo+1440; // para cuando sean las 12 de la noche (00 horas) 
  }  
 Luces (tiempo); 
} 
int Porcent(int Valor, int Maximo)
{
  int result;
  result = Valor * 100;
  result = result / Maximo;
  return result;
}

 
void Luces(int tiempo)  
{  
 ///////////tiempos de progamacion//////////  
//conversion seria 60x11=660 la misma tabla para los demas parametros //

int PotAzul;  
   int InicioAmanecerAzul=660;      //11:00   
   int FinAmanecerAzul=720;         //12:00           
   int InicioAnochecerAzul=1260;    //21:00   
   int FinAnochecerAzul=1380;       //23:00 
// int FinLuzLuna=1380;             //23:00// 
   int MaxAzul=250; //Maximo que vamos a encender los LED sobre 255  
   int PorAzules;
int PotBLAN;  
   int InicioAmanecerLED=720; //12:00   
   int FinAmanecerLED=780;  //13:00 //  
   int InicioAnochecerLED=1200; //20:00//  
   int FinAnochecerLED=1260;  //21:00          
   int MaxLED=250; //Maximo que vamos a encender los LED sobre 255  
   int PorBLAN;


//////////////////// Azul //////////////////////// 
 //Noche  
 if (tiempo >FinAnochecerAzul || tiempo < InicioAmanecerAzul )   
 {  
   PotAzul=0;  
   Serial.println(); 
   Serial.print("NOCHE AZUL: "); 
   Serial.println(PotAzul); 
   Serial.println();  
  }  
  //Amanecer  
 if (tiempo >= InicioAmanecerAzul && tiempo <= FinAmanecerAzul)
 {  
  PotAzul=map(tiempo,InicioAmanecerAzul,FinAmanecerAzul,0,MaxAzul);  
   Serial.println(); 
   Serial.print("AMANECIENDO AZUL: "); 
   Serial.println(PotAzul);  
   Serial.println(); 
  }  

 //Dia  
 if (tiempo > FinAmanecerAzul && tiempo < InicioAnochecerAzul) 
  {  
   PotAzul=MaxAzul;  
   Serial.println(); 
   Serial.print("DIA AZUL: "); 
   Serial.println(PotAzul);  
   Serial.println(); 
  }  

 //Anochecer  
 if (tiempo >= InicioAnochecerAzul && tiempo <= FinAnochecerAzul)
{  
   PotAzul=map(tiempo,InicioAnochecerAzul,FinAnochecerAzul,MaxAzul,0);  
   Serial.println(); 
   Serial.print("ANOCHECIENDO AZUL: "); 
   Serial.println(PotAzul);  
   Serial.println(); 
  }
  
 /////////////////// PotLED ///////////////////////
  //Noche  
 if (tiempo >FinAnochecerLED || tiempo < InicioAmanecerLED )   
 {  
   PotBLAN=0;  
   }
    
  //Amanecer  
 if (tiempo >= InicioAmanecerLED && tiempo <= FinAmanecerLED)
  {  
   PotBLAN=map(tiempo,InicioAmanecerLED,FinAmanecerLED,0,MaxLED);  
    }
    
 //Dia  
 if (tiempo > FinAmanecerLED && tiempo < InicioAnochecerLED) 
 {  
   PotBLAN=MaxLED;  
   }  
 
 //Anochecer  
 if (tiempo >= InicioAnochecerLED && tiempo <= FinAnochecerLED)
  {  
   PotBLAN=map(tiempo,InicioAnochecerLED,FinAnochecerLED,MaxLED,0);  
  }
     
 //////////////// PORCENTAJE  LUZ///////////////////// 

   PorAzules = Porcent(PotAzul , 255);
   PorBLAN = Porcent(PotBLAN , 255);
 
    ///// INOFORMACION EN PANTALLA LCD ////////

  lcd.clear();
 // lcd.backlight();
  lcd.setCursor(0, 0);
        if (tiempo >= InicioAmanecerAzul && tiempo <= FinAmanecerAzul)
               lcd.print("   AMANECIENDO");
       if (tiempo > FinAmanecerAzul && tiempo < InicioAnochecerAzul)
               lcd.print("     DIA");
       if (tiempo >= InicioAnochecerAzul && tiempo <= FinAnochecerAzul)
              lcd.print("   ANOCHECER"); 
        if (tiempo >FinAnochecerAzul || tiempo < InicioAmanecerAzul )
      //          PotAzul=map(tiempo,InicioAnochecerAzul,FinAnochecerAzul,MaxAzul,0);
             lcd.print("    NOCHE ");
 
   lcd.setCursor(2, 1);
   lcd.print("Pot Luz");
 // lcd.setCursor(0, 1);
 // lcd.print("Pot BLAN");
  lcd.setCursor(10, 1);
  if (PorAzules < 10) lcd.print("0");
  lcd.print(PorAzules);
  lcd.print(" % ");
   delay (3000);  // Pausa 3 segundos
 

//Nombre proyecto     

  lcd.clear();
 
  lcd.setCursor(2, 0);
  lcd.print("PANTALLA LUZ");
  lcd.setCursor(4, 1);
  lcd.print("VER. 0.1");
   delay (3000); 
 
  // Sensor Temperatura

  sensors.requestTemperatures(); // Envia el comando para obtener temperatura
  Celsius = sensors.getTempCByIndex(0);
  lcd.clear();
 
  lcd.setCursor(1, 0);
  lcd.print("TEMP. ACUARIO: ");
  lcd.setCursor(3, 1);
  lcd.print(Celsius);
  lcd.setCursor(10, 1);
  lcd.print("\337C");   
  delay (3000);   
 
 



    
    //////////////// Declaracion de pines   /////////////////

 for (int i=0;i<Pleds;i++)

   analogWrite(led[i],PotBLAN); // El pines del 6 al 9 seran de salida
   
 analogWrite(5, PotAzul);  
    
 //analogWrite(9, PotLED);  
 //analogWrite(10, PotAzul);  

   delay(1000);  
}

Borra

#define ApagoLCD

no se para que lo has puesto.
Esas son dos funciones llamadas por TimeAlarm.

ApagoLCD y EnciendoLCD

corregido fue un de los tantos momentos de genialidades que tuve y se me olvido sacar pero me reclama esto

exit status 1
'ApagoLCD' was not declared in this scope

Al poner esta parte dentro del loop salta el error

   ///////  Apaga LCD y Enciende LCD /////////////  
 {
 digitalClockDisplay();
  Alarm.delay(1000); //espere un segundo entre la visualización del reloj
}
// funciones a llamar cuando se dispara una alarma:
void ApagoLCD(){
 lcd.noBacklight();
  Serial.println("Alarm: - LCD Apagado"); 
 }
void EnciendoLCD(){
  lcd.backlight();
  Serial.println("Alarm: - LCD Encendido");
 }
void digitalClockDisplay()
{
 }

qué parte, no se entiende!!

Para mi mucho no lo entiendo, tal vez son cosas muy sencillas pero esto de programacion no se meda y trato de solucionarlo hago los ejemplos y funcionan pero al integrarlos con el programa se me va al carajo.
Este es el error

exit status 1
'ApagoLCD' was not declared in this scope

#include <Wire.h>    
#include <Arduino.h>
#include <LiquidCrystal_I2C.h>       
LiquidCrystal_I2C lcd(0x3F, 16, 2);  
#include <OneWire.h>                     //temperatura
#include <DallasTemperature.h>           //temperatura 
#include "RTClib.h" 
#include <Time.h>
#include <TimeLib.h>
#include <TimeAlarms.h>
RTC_DS1307 rtc;//RTC_DS3231 RTC;
#define ONE_WIRE_BUS 12                  //temperatura, pin de entrada
#define Pleds  4 //creamos la variable leds de 4 elementos **** prue1az4blan
int led[Pleds] = {6,9,10,11}; //creamos un vector para los pines a utilizar **** prue1az4blan
OneWire oneWire(ONE_WIRE_BUS);           //temperatura
DallasTemperature sensors(&oneWire);     //temperatura
float Celsius = 0;                       // car127 de esquema term lcd

void setup () { 
     Serial.begin(9600);           // Establece la velocidad de datos del puerto serie 
  
  // Crea las alarmas 
 setTime(10,8,0,1,1,11); // Establece la hora y fecha 8:29:00am Jan 1 2011

Alarm.alarmRepeat(23,00,0,ApagoLCD);  // 23:00pm cada dia ApagoLCD
Alarm.alarmRepeat(10,00,0, EnciendoLCD);  // 10:00am cada dia 
  
     Wire.begin();                 // Establece la velocidad de datos del bus I2C 
     sensors.begin();              //Temperatura
     rtc.begin();                  // Establece la velocidad de datos del RTC 
 // rtc.adjust(DateTime(__DATE__), (__TIME__));
 // rtc.adjust(DateTime(2017, 11, 24, 22, 12, 0));
     lcd.begin();
    while (!Serial); // for Leonardo/Micro/Zero
 
  } 

void loop () { 

 {  
  digitalClockDisplay();
  Alarm.delay(1000); //espere un segundo entre la visualización del reloj
}
// funciones a llamar cuando se dispara una alarma:
void ApagoLCD(){
 lcd.noBacklight();
  Serial.println("Alarm: - LCD Apagado"); 
 }
void EnciendoLCD(){
  lcd.backlight();
  Serial.println("Alarm: - LCD Encendido");
 }
void digitalClockDisplay()
{
 
}
  //int minute; 
 // int hour; 
  int tiempo; 
  
  DateTime now = rtc.now();            // Obtiene la fecha y hora del RTC 



// ahora mostrar fecha y hora
  lcd.clear(); 
  //lcd.backlight(); 
  lcd.setCursor(0,1);
  lcd.print("Hora:"); 
  lcd.print(" ");
  if (now.hour() < 10)              //  si hora es menor a 10 
 {                                   //  coloque un 0
  lcd.print("0");                    //       y
 }                                   //      se
 lcd.print(now.hour(), DEC);         //    leera 08
  lcd.print(":"); 
 if (now.minute() < 10)               
 {                                   
  lcd.print("0");                    
 }
  lcd.print(now.minute(), DEC);   
  lcd.setCursor(0,0); 
  lcd.print("Fecha:");
  lcd.print(""); 
  lcd.print(now.day(), DEC); 
  lcd.print("/"); 
  lcd.print(now.month(), DEC); 
  lcd.print("/"); 
  lcd.print(now.year(), DEC); 
   
       //  lcd.print("   "); 
  delay (3000);     // Pausa 3 segundos 
  //lcd.noBacklight(); 
 // delay (3000);   

tiempo=(now.hour()*60)+now.minute(); // Para que sea un numero entero lo medimos en minutos 

 if (tiempo < 60)  
  {  
   tiempo=tiempo+1440; // para cuando sean las 12 de la noche (00 horas) 
  }  
 Luces (tiempo); 
} 
int Porcent(int Valor, int Maximo)
{
  int result;
  result = Valor * 100;
  result = result / Maximo;
  return result;
}

 
void Luces(int tiempo)  
{  
 ///////////tiempos de progamacion//////////  
//conversion seria 60x11=660 la misma tabla para los demas parametros //

int PotAzul;  
   int InicioAmanecerAzul=660;      //11:00   
   int FinAmanecerAzul=720;         //12:00           
   int InicioAnochecerAzul=1260;    //21:00   
   int FinAnochecerAzul=1380;       //23:00 
// int FinLuzLuna=1380;             //23:00// 
   int MaxAzul=250; //Maximo que vamos a encender los LED sobre 255  
   int PorAzules;
int PotBLAN;  
   int InicioAmanecerLED=720; //12:00   
   int FinAmanecerLED=780;  //13:00 //  
   int InicioAnochecerLED=1200; //20:00//  
   int FinAnochecerLED=1260;  //21:00          
   int MaxLED=250; //Maximo que vamos a encender los LED sobre 255  
   int PorBLAN;


//////////////////// Azul //////////////////////// 
 //Noche  
 if (tiempo >FinAnochecerAzul || tiempo < InicioAmanecerAzul )   
 {  
   PotAzul=0;  
   Serial.println(); 
   Serial.print("NOCHE AZUL: "); 
   Serial.println(PotAzul); 
   Serial.println();  
  }  
  //Amanecer  
 if (tiempo >= InicioAmanecerAzul && tiempo <= FinAmanecerAzul)
 {  
  PotAzul=map(tiempo,InicioAmanecerAzul,FinAmanecerAzul,0,MaxAzul);  
   Serial.println(); 
   Serial.print("AMANECIENDO AZUL: "); 
   Serial.println(PotAzul);  
   Serial.println(); 
  }  

 //Dia  
 if (tiempo > FinAmanecerAzul && tiempo < InicioAnochecerAzul) 
  {  
   PotAzul=MaxAzul;  
   Serial.println(); 
   Serial.print("DIA AZUL: "); 
   Serial.println(PotAzul);  
   Serial.println(); 
  }  

 //Anochecer  
 if (tiempo >= InicioAnochecerAzul && tiempo <= FinAnochecerAzul)
{  
   PotAzul=map(tiempo,InicioAnochecerAzul,FinAnochecerAzul,MaxAzul,0);  
   Serial.println(); 
   Serial.print("ANOCHECIENDO AZUL: "); 
   Serial.println(PotAzul);  
   Serial.println(); 
  }
  
 /////////////////// PotLED ///////////////////////
  //Noche  
 if (tiempo >FinAnochecerLED || tiempo < InicioAmanecerLED )   
 {  
   PotBLAN=0;  
   }
    
  //Amanecer  
 if (tiempo >= InicioAmanecerLED && tiempo <= FinAmanecerLED)
  {  
   PotBLAN=map(tiempo,InicioAmanecerLED,FinAmanecerLED,0,MaxLED);  
    }
    
 //Dia  
 if (tiempo > FinAmanecerLED && tiempo < InicioAnochecerLED) 
 {  
   PotBLAN=MaxLED;  
   }  
 
 //Anochecer  
 if (tiempo >= InicioAnochecerLED && tiempo <= FinAnochecerLED)
  {  
   PotBLAN=map(tiempo,InicioAnochecerLED,FinAnochecerLED,MaxLED,0);  
  }
     
 //////////////// PORCENTAJE  LUZ///////////////////// 

   PorAzules = Porcent(PotAzul , 255);
   PorBLAN = Porcent(PotBLAN , 255);
 
    ///// INOFORMACION EN PANTALLA LCD ////////

  lcd.clear();
 // lcd.backlight();
  lcd.setCursor(0, 0);
        if (tiempo >= InicioAmanecerAzul && tiempo <= FinAmanecerAzul)
               lcd.print("   AMANECIENDO");
       if (tiempo > FinAmanecerAzul && tiempo < InicioAnochecerAzul)
               lcd.print("     DIA");
       if (tiempo >= InicioAnochecerAzul && tiempo <= FinAnochecerAzul)
              lcd.print("   ANOCHECER"); 
        if (tiempo >FinAnochecerAzul || tiempo < InicioAmanecerAzul )
      //          PotAzul=map(tiempo,InicioAnochecerAzul,FinAnochecerAzul,MaxAzul,0);
             lcd.print("    NOCHE ");
 
   lcd.setCursor(2, 1);
   lcd.print("Pot Luz");
 // lcd.setCursor(0, 1);
 // lcd.print("Pot BLAN");
  lcd.setCursor(10, 1);
  if (PorAzules < 10) lcd.print("0");
  lcd.print(PorAzules);
  lcd.print(" % ");
   delay (3000);  // Pausa 3 segundos
 

//Nombre proyecto     

  lcd.clear();
 
  lcd.setCursor(2, 0);
  lcd.print("PANTALLA LUZ");
  lcd.setCursor(4, 1);
  lcd.print("VER. 0.1");
   delay (3000); 
 
  // Sensor Temperatura

  sensors.requestTemperatures(); // Envia el comando para obtener temperatura
  Celsius = sensors.getTempCByIndex(0);
  lcd.clear();
 
  lcd.setCursor(1, 0);
  lcd.print("TEMP. ACUARIO: ");
  lcd.setCursor(3, 1);
  lcd.print(Celsius);
  lcd.setCursor(10, 1);
  lcd.print("\337C");   
  delay (3000);   
 
 



    
    //////////////// Declaracion de pines   /////////////////

 for (int i=0;i<Pleds;i++)

   analogWrite(led[i],PotBLAN); // El pines del 6 al 9 seran de salida
   
 analogWrite(5, PotAzul);  
    
 //analogWrite(9, PotLED);  
 //analogWrite(10, PotAzul);  

   delay(1000);  
}

car127 de verdad no quiero ser irrespetuoso pero has visto el código que has subido.

Tiene como dos programas mezclados con cosas por la mitad, partes que has quitado, otras que no se entiende donde empiezas y terminan.

Entiendo que estes aprendiendo pero es caótico.

Veré como ayudarte pero no tengo tu librería liquidcrystal y me da error empezando por ahi sin contar todo lo demas.

Por cierto, el IDE tiene una opción de autoformato, úsala!! me cuesta tener que corregir todo cada vez que levanto un código y disculpa mi intolerancia pero al menos hazle un poco mas fácil la tarea a quienes queremos ayudar... y ya se que soy cascarrabias.. me lo dicen todo el tiempo!! jajaja

A ver si el humor ayuda, al menos hoy que estoy de buenas.

Bueno asi compila, he cambiado dos lineas

//LiquidCrystal_I2C lcd(0x3F, 16, 2);  
LiquidCrystal_I2C lcd(0x3F);  // Set the LCD I2C address

y esta

  //lcd.begin();
  lcd.begin(16,2);               // initialize the lcd

Las comentadas son las tuyas. Las no comentadas son las que mi librería permite que compile sino me da error.
Asi el resto del código funciona sin errores.
No se si funciona como lo que tu esperas.

#include <Wire.h>    
#include <Arduino.h>
#include <LiquidCrystal_I2C.h>       
//LiquidCrystal_I2C lcd(0x3F, 16, 2);  
LiquidCrystal_I2C lcd(0x3F);  // Set the LCD I2C address
#include <OneWire.h>                     //temperatura
#include <DallasTemperature.h>           //temperatura 
#include "RTClib.h" 
#include <Time.h>
#include <TimeLib.h>
#include <TimeAlarms.h>
RTC_DS1307 rtc;//RTC_DS3231 RTC;
#define ONE_WIRE_BUS 12                  //temperatura, pin de entrada
#define Pleds  4 //creamos la variable leds de 4 elementos **** prue1az4blan
int led[Pleds] = {6,9,10,11}; //creamos un vector para los pines a utilizar **** prue1az4blan
OneWire oneWire(ONE_WIRE_BUS);           //temperatura
DallasTemperature sensors(&oneWire);     //temperatura
float Celsius = 0;                       // car127 de esquema term lcd

void setup () { 
  Serial.begin(9600);           // Establece la velocidad de datos del puerto serie 
  
  // Crea las alarmas 
  setTime(10,8,0,1,1,11); // Establece la hora y fecha 8:29:00am Jan 1 2011

  Alarm.alarmRepeat(23,00,0,ApagoLCD);  // 23:00pm cada dia ApagoLCD
  Alarm.alarmRepeat(10,00,0, EnciendoLCD);  // 10:00am cada dia 
  
  Wire.begin();                 // Establece la velocidad de datos del bus I2C 
  sensors.begin();              //Temperatura
  rtc.begin();                  // Establece la velocidad de datos del RTC 
  // rtc.adjust(DateTime(__DATE__), (__TIME__));
  // rtc.adjust(DateTime(2017, 11, 24, 22, 12, 0));
  //lcd.begin();
  lcd.begin(16,2);               // initialize the lcd 
  while (!Serial); // for Leonardo/Micro/Zero
 
} 

void loop () {   
  digitalClockDisplay();
  Alarm.delay(1000); //espere un segundo entre la visualización del reloj
}

// funciones a llamar cuando se dispara una alarma:
void ApagoLCD(){
  lcd.noBacklight();
  Serial.println("Alarm: - LCD Apagado"); 
}

void EnciendoLCD(){
  lcd.backlight();
  Serial.println("Alarm: - LCD Encendido");
}

void digitalClockDisplay() {
 
  //int minute; 
  // int hour; 
  int tiempo; 
  
  DateTime now = rtc.now();            // Obtiene la fecha y hora del RTC 

  // ahora mostrar fecha y hora
  lcd.clear(); 
  //lcd.backlight(); 
  lcd.setCursor(0,1);
  lcd.print("Hora:"); 
  lcd.print(" ");
  if (now.hour() < 10) {              //  si hora es menor a 10 
                                      //  coloque un 0
      lcd.print("0");                    //       y
  }                                   //      se
  lcd.print(now.hour(), DEC);         //    leera 08
  lcd.print(":"); 
  if (now.minute() < 10)  {                                   
      lcd.print("0");                    
  }
  lcd.print(now.minute(), DEC);   
  lcd.setCursor(0,0); 
  lcd.print("Fecha:");
  lcd.print(""); 
  lcd.print(now.day(), DEC); 
  lcd.print("/"); 
  lcd.print(now.month(), DEC); 
  lcd.print("/"); 
  lcd.print(now.year(), DEC); 
   
  //  lcd.print("   "); 
  delay (3000);     // Pausa 3 segundos 
  //lcd.noBacklight(); 
  // delay (3000);   

  tiempo=(now.hour()*60)+now.minute(); // Para que sea un numero entero lo medimos en minutos 

  if (tiempo < 60)    {  
     tiempo=tiempo+1440; // para cuando sean las 12 de la noche (00 horas) 
  }  
  Luces (tiempo); 
} 

int Porcent(int Valor, int Maximo) {
  int result;
  result = Valor * 100;
  result = result / Maximo;
  return result;
}

 
void Luces(int tiempo)    {  
  ///////////tiempos de progamacion//////////  
  //conversion seria 60x11=660 la misma tabla para los demas parametros //

  int PotAzul;  
  int InicioAmanecerAzul=660;      //11:00   
  int FinAmanecerAzul=720;         //12:00           
  int InicioAnochecerAzul=1260;    //21:00   
  int FinAnochecerAzul=1380;       //23:00 
  // int FinLuzLuna=1380;             //23:00// 
  int MaxAzul=250; //Maximo que vamos a encender los LED sobre 255  
  int PorAzules;
  int PotBLAN;  
  int InicioAmanecerLED=720; //12:00   
  int FinAmanecerLED=780;  //13:00 //  
  int InicioAnochecerLED=1200; //20:00//  
  int FinAnochecerLED=1260;  //21:00          
  int MaxLED=250; //Maximo que vamos a encender los LED sobre 255  
  int PorBLAN;


  //////////////////// Azul //////////////////////// 
  //Noche  
  if (tiempo >FinAnochecerAzul || tiempo < InicioAmanecerAzul )     {  
      PotAzul=0;  
      Serial.println(); 
      Serial.print("NOCHE AZUL: "); 
      Serial.println(PotAzul); 
      Serial.println();  
  }  
  //Amanecer  
  if (tiempo >= InicioAmanecerAzul && tiempo <= FinAmanecerAzul)  {  
      PotAzul=map(tiempo,InicioAmanecerAzul,FinAmanecerAzul,0,MaxAzul);  
      Serial.println(); 
      Serial.print("AMANECIENDO AZUL: "); 
      Serial.println(PotAzul);  
      Serial.println(); 
  }  

  //Dia  
  if (tiempo > FinAmanecerAzul && tiempo < InicioAnochecerAzul)   {  
      PotAzul=MaxAzul;  
      Serial.println(); 
      Serial.print("DIA AZUL: "); 
      Serial.println(PotAzul);  
      Serial.println(); 
  }  

  //Anochecer  
  if (tiempo >= InicioAnochecerAzul && tiempo <= FinAnochecerAzul)  {  
      PotAzul=map(tiempo,InicioAnochecerAzul,FinAnochecerAzul,MaxAzul,0);  
      Serial.println(); 
      Serial.print("ANOCHECIENDO AZUL: "); 
      Serial.println(PotAzul);  
      Serial.println(); 
  }

  /////////////////// PotLED ///////////////////////
  //Noche  
  if (tiempo >FinAnochecerLED || tiempo < InicioAmanecerLED )    {  
      PotBLAN=0;  
  }

  //Amanecer  
  if (tiempo >= InicioAmanecerLED && tiempo <= FinAmanecerLED)  {  
      PotBLAN=map(tiempo,InicioAmanecerLED,FinAmanecerLED,0,MaxLED);  
  }

  //Dia  
  if (tiempo > FinAmanecerLED && tiempo < InicioAnochecerLED)   {  
      PotBLAN=MaxLED;  
  }  

  //Anochecer  
  if (tiempo >= InicioAnochecerLED && tiempo <= FinAnochecerLED)  {  
      PotBLAN=map(tiempo,InicioAnochecerLED,FinAnochecerLED,MaxLED,0);  
  }

  //////////////// PORCENTAJE  LUZ///////////////////// 

  PorAzules = Porcent(PotAzul , 255);
  PorBLAN = Porcent(PotBLAN , 255);

  ///// INOFORMACION EN PANTALLA LCD ////////

  lcd.clear();
  // lcd.backlight();
  lcd.setCursor(0, 0);
  if (tiempo >= InicioAmanecerAzul && tiempo <= FinAmanecerAzul)
      lcd.print("   AMANECIENDO");
  if (tiempo > FinAmanecerAzul && tiempo < InicioAnochecerAzul)
      lcd.print("     DIA");
  if (tiempo >= InicioAnochecerAzul && tiempo <= FinAnochecerAzul)
      lcd.print("   ANOCHECER"); 
  if (tiempo >FinAnochecerAzul || tiempo < InicioAmanecerAzul )
  //          PotAzul=map(tiempo,InicioAnochecerAzul,FinAnochecerAzul,MaxAzul,0);
      lcd.print("    NOCHE ");

  lcd.setCursor(2, 1);
  lcd.print("Pot Luz");
  // lcd.setCursor(0, 1);
  // lcd.print("Pot BLAN");
  lcd.setCursor(10, 1);
  if (PorAzules < 10) lcd.print("0");
  lcd.print(PorAzules);
  lcd.print(" % ");
  delay (3000);  // Pausa 3 segundos


  //Nombre proyecto     

  lcd.clear();

  lcd.setCursor(2, 0);
  lcd.print("PANTALLA LUZ");
  lcd.setCursor(4, 1);
  lcd.print("VER. 0.1");
  delay (3000); 

  // Sensor Temperatura

  sensors.requestTemperatures(); // Envia el comando para obtener temperatura
  Celsius = sensors.getTempCByIndex(0);
  lcd.clear();

  lcd.setCursor(1, 0);
  lcd.print("TEMP. ACUARIO: ");
  lcd.setCursor(3, 1);
  lcd.print(Celsius);
  lcd.setCursor(10, 1);
  lcd.print("\337C");   
  delay (3000);   

  //////////////// Declaracion de pines   /////////////////

  for (int i=0;i<Pleds;i++)
  analogWrite(led[i],PotBLAN); // El pines del 6 al 9 seran de salida
  analogWrite(5, PotAzul);  

  //analogWrite(9, PotLED);  
  //analogWrite(10, PotAzul);  

  delay(1000);  
}

Probado y funcionando con mis librerías
gracias en unos días mas molestare otra vez