Go Down

Topic: problema a far rimanere data e ora corretta su rtc (Read 10264 times) previous topic - next topic

marco3020

Aug 23, 2015, 06:19 am Last Edit: Aug 23, 2015, 06:19 am by marco3020
Buongiorno ho un mega 2560 quando carico lo sketch mi da dat e ora corretta ma se stacco corrente ritorna indietro a quando lo avevo compilato, seguendo la procedura cioè flasharlo con la riga adjust time e poi senza quella riga va alle 6.28 del 2106 cosa posso fare?, leggevo su internet che lo sketch bisogna che venga passato anche dall rtc con un pulsante  intanto ecco mio sketch :

Code: [Select]
#include <Wire.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#include <Wire.h>
#include <RTClib.h>

RTC_Millis RTC;

PCF8574_HD44780_I2C lcd(0x3F, 20, 4);

int oraAlba = 9;
int minAlba = 10;
long albas;
int durataAlbas = 720;
int oraTramonto = 17;
int minTramonto = 10;
long tramontos;
int durataTramontos = 720;
long nows;
int delayR = 0;
int delayG = 120;
int delayB = 240;
int delayUV = 360;
int delayW = 360;

int pinR = 2;
int pinG = 3;
int pinB = 4;
int pinW = 5;
int pinUV = 6;

//rele
float rele1 = 35;
float rele2 = 37;
int rele3 = 39;
float rele4 = 41;
int rele5 = 43;

char buffer1[20];
char buffer2[20];

float riscaldatore = 22.0; // allerta temperatura acqua bassa
float alertacqua = 26.0; // ventola tangenziale
float alertplafo = 44.0; // alerta plafoniera temperatura troppo alta
float tempSoglia = 38.0; //temperatura ventole plafo

#define ONE_WIRE_BUS 7
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
DeviceAddress tmp_address;
float temp0=0;
float temp1=0;
int numberOfDevices;

#define VENTOLA 35
#define TANG 37
#define NOTTE 39
#define PUMP 41
#define PUMP1 43
#define RISC 45

void setup()
{


lcd.init(); // LCD Initialization
lcd.backlight( ); // Backlight ON
lcd.clear(); // Clear the display

numberOfDevices = 1;

Serial.begin(9600);
Wire.begin();

sensors.begin();

pinMode(pinR, OUTPUT);
pinMode(pinG, OUTPUT);
pinMode(pinB, OUTPUT);
pinMode(pinW, OUTPUT);
pinMode(pinUV, OUTPUT);

pinMode(rele1, OUTPUT);
pinMode(rele2, OUTPUT);
pinMode(rele3, OUTPUT);
pinMode(rele4, OUTPUT);
pinMode(rele5, OUTPUT);

pinMode(VENTOLA, OUTPUT);
pinMode(TANG, OUTPUT);

pinMode(RISC, OUTPUT);
pinMode(NOTTE, OUTPUT);
pinMode(PUMP, OUTPUT);
pinMode(PUMP1, OUTPUT);

digitalWrite( rele1, LOW );
digitalWrite( rele2, LOW );
digitalWrite( rele3, LOW );
digitalWrite( rele4, LOW );
digitalWrite(rele5, LOW);

///////////////////////////// SETTAGGIO ORA ////////////////////////////////////
/*
Come settare correttamente ora:
1) compilare lo sketch con quella riga , a) oppure b)
2) flashare l'Arduino con quello sketch, in modo che lo sketch regoli l'RTC
3) ricompilare lo sketch SENZA quella riga
4) riflashare l'Arduino con il nuovo sketch

Ora puoi fare tutti gli stacchi che vuoi e l'RTC andrà per conto suo correttamente.*/


RTC.adjust(DateTime(__DATE__, __TIME__)); // settaggio ora automatico b)
//RTC.begin(DateTime(__DATE__, __TIME__));
///////////////////////////////////////////////////////////////////////////////////

delay(3000);
}

void loop() {


// prendo ora attuale
DateTime now = RTC.now();
sprintf(buffer1, "%02d:%02d:%02d", now.hour(), now.minute(), now.second());
lcd.setCursor(0,0);
lcd.print( buffer1 );

sprintf(buffer2, "%02d/%02d/%d", now.day(), now.month(), now.year());
lcd.setCursor(0,1);
lcd.print( buffer2 );
Serial.println(buffer1);
Serial.println(buffer2);

// Richiesta temperatura
sensors.requestTemperatures(); // Comando per misurare la temp.
temp0 = sensors.getTempCByIndex(0);
lcd.setCursor(0,2); // Colonna 0, Riga 0
lcd.print("acqua:");
lcd.setCursor (6, 2);
lcd.print(temp0);

temp1 = sensors.getTempCByIndex(1);
lcd.setCursor (0,3); //Colonna 0, Riga 1
lcd.print("plafo:");
lcd.setCursor (6,3);
lcd.print(temp1);



//PLAFONIERA =TEMP1 vetole

if (temp1 > tempSoglia - 0.2 and - 0.6 ) {
digitalWrite(VENTOLA, LOW);
}
if (temp1 < tempSoglia + 0.2 and + 0.6) {
digitalWrite(VENTOLA, HIGH);
}

// ventola tangenziale

if (temp0 > alertacqua - 0.2 and - 0.6) {
digitalWrite(TANG, LOW);
}
if (temp0 < alertacqua + 0.2 and + 0.6) {
digitalWrite(TANG, HIGH);
}
// riscaldatore

if (temp0> riscaldatore + 1.0 and +4.0 ) {
digitalWrite (RISC, LOW);
}

if (temp0< riscaldatore - 1.0 and - 4.0 ){
digitalWrite (RISC, HIGH);

}


// Calcolo inizio alba in secondi
albas = oraAlba * 3600 + minAlba * 60;

// Calcolo inizio tramonto in secondi
tramontos = oraTramonto * 3600 + minTramonto * 60;

// Calcolo attuale in secondi
nows = now.hour() * 3600 + now.minute() * 60 + now.second();

// Notte
if (nows < albas || nows > tramontos + durataTramontos) {

digitalWrite(pinR, LOW);
digitalWrite(pinG, LOW);
digitalWrite(pinB, LOW);
digitalWrite(pinUV, LOW);
digitalWrite(pinW, LOW);

digitalWrite(NOTTE, HIGH);
digitalWrite(PUMP, LOW);
digitalWrite(PUMP1, HIGH);

}

// Alba
if (nows > albas && nows + delayR < albas + durataAlbas) {
analogWrite(pinR, 65 * (float)(((albas + durataAlbas) - nows) / (durataAlbas - delayR)));
}
if (nows > albas && nows + delayG < albas + durataAlbas) {
analogWrite(pinG, 65 * (float)(((albas + durataAlbas) - nows) / (durataAlbas - delayG)));
}
if (nows > albas && nows + delayB < albas + durataAlbas) {
analogWrite(pinB, 65 * (float)(((albas + durataAlbas) - nows) / (durataAlbas - delayB)));
}
if (nows > albas && nows + delayUV < albas + durataAlbas) {
analogWrite(pinUV, 65 * (float)(((albas + durataAlbas) - nows) / (durataAlbas - delayUV)));
}
if (nows > albas && nows + delayW < albas + durataAlbas) {
analogWrite(pinW, 65 * (float)(((albas + durataAlbas) - nows) / (durataAlbas - delayW)));
}

// Giorno
if (nows > albas + durataAlbas && nows < tramontos) {
digitalWrite(pinR, HIGH);
digitalWrite(pinG, HIGH);
digitalWrite(pinB, HIGH);
digitalWrite(pinUV, HIGH);
digitalWrite(pinW, HIGH);
digitalWrite(PUMP,HIGH);
digitalWrite (PUMP1,LOW);
digitalWrite (NOTTE, LOW);
}


if ( temp1 > alertplafo + 0.2 and + 0.6 ) {
digitalWrite(pinR, LOW);
digitalWrite(pinG, LOW);
digitalWrite(pinB, LOW);
digitalWrite(pinUV, LOW);
digitalWrite(pinW, LOW);




}

// Tramonto
if (nows > tramontos && nows + delayR < tramontos + durataTramontos) {
int v = 65 - (65 * (float)(((tramontos + durataTramontos) - nows) / (durataTramontos - delayR)));
analogWrite(pinR, v);
}
if (nows > tramontos && nows + delayG < tramontos + durataTramontos) {
int v = 65 - (65 * (float)(((tramontos + durataTramontos) - nows) / (durataTramontos - delayG)));
analogWrite(pinG, v);
}
if (nows > tramontos && nows + delayB < tramontos + durataTramontos) {
int v = 65 - (65 * (float)(((tramontos + durataTramontos) - nows) / (durataTramontos - delayB)));
analogWrite(pinB, v);
}
if (nows > tramontos && nows + delayUV < tramontos + durataTramontos) {
int v = 65 - (65 * (float)(((tramontos + durataTramontos) - nows) / (durataTramontos - delayUV)));
analogWrite(pinUV, v);
}
if (nows > tramontos && nows + delayW < tramontos + durataTramontos) {
int v = 65 - (65 * (float)(((tramontos + durataTramontos) - nows) / (durataTramontos - delayW)));
analogWrite(pinW, v);
}

}
[code]


GiovanniGiga

Non ne sono sicuro, ma prova a controllare se la batteria dell' RTC è carica.

uwefed

1) Quale RTC hai?
2) quale libreria usi (prego link)
3) Controla la tensione dei 5V
4) controlla tensione della batteria.

Ciao Uwe

SukkoPera

Ho avuto lo stesso problema tempo fa e il problema era... Appunto la batteria! Ne avevo presi due e uno era arrivato con la batteria scarica.
"Code is read much more often than it is written, so plan accordingly. Design for readability."

Guida rapida a ESP8266: https://goo.gl/kzh62E

GiovanniGiga

#4
Aug 23, 2015, 01:37 pm Last Edit: Aug 23, 2015, 01:38 pm by GiovanniGiga
io mi chiedo come mai le vendono con la batteria scarica  :o

cyberhs

Hai commesso un errore, questa istruzione usa il timer di Arduino e non il modulo RTC.

RTC_Millis RTC;

Usa invece:

RTC_DS1307 RTC;

marco3020

ho provato a cambiare con RTC_DS1307 RTC; ma non va

marco3020

#7
Aug 23, 2015, 03:22 pm Last Edit: Aug 23, 2015, 03:26 pm by marco3020
1) Quale RTC hai?
2) quale libreria usi (prego link)
3) Controla la tensione dei 5V
4) controlla tensione della batteria.

Ciao Uwe
RTC DS1307

libreria quersta:
#include <RTClib.h>

la batteria è carica appena provata con il tester  ed è 3.07


cyberhs


marco3020

ok scaricata domani al provo e vi aggiorno grazie per ora

uwefed


marco3020

ho provato a mettere questa libreria consiglita e ora mi da questo errore ;   This report would have more information with
  "Show verbose output during compilation"
  enabled in File > Preferences.
Arduino: 1.0.6 (Windows NT (unknown)), Board: "Arduino Mega 2560 or Mega ADK"
In file included from sketch_jun07a_funz__rel_.ino:2:
C:\Users\marco\Documents\Arduino\libraries\RTClib-master/RTClib.h:12: error: expected `)' before 't'
C:\Users\marco\Documents\Arduino\libraries\RTClib-master/RTClib.h:13: error: expected `)' before 'year'
C:\Users\marco\Documents\Arduino\libraries\RTClib-master/RTClib.h:17: error: expected ',' or '...' before '*' token
C:\Users\marco\Documents\Arduino\libraries\RTClib-master/RTClib.h:17: error: ISO C++ forbids declaration of '__FlashStringHelper' with no type
C:\Users\marco\Documents\Arduino\libraries\RTClib-master/RTClib.h:18: error: 'uint16_t' does not name a type
C:\Users\marco\Documents\Arduino\libraries\RTClib-master/RTClib.h:19: error: 'uint8_t' does not name a type
C:\Users\marco\Documents\Arduino\libraries\RTClib-master/RTClib.h:20: error: 'uint8_t' does not name a type
C:\Users\marco\Documents\Arduino\libraries\RTClib-master/RTClib.h:21: error: 'uint8_t' does not name a type
C:\Users\marco\Documents\Arduino\libraries\RTClib-master/RTClib.h:22: error: 'uint8_t' does not name a type
C:\Users\marco\Documents\Arduino\libraries\RTClib-master/RTClib.h:23: error: 'uint8_t' does not name a type
C:\Users\marco\Documents\Arduino\libraries\RTClib-master/RTClib.h:24: error: 'uint8_t' does not name a type
C:\Users\marco\Documents\Arduino\libraries\RTClib-master/RTClib.h:29: error: 'uint32_t' does not name a type
C:\Users\marco\Documents\Arduino\libraries\RTClib-master/RTClib.h:36: error: 'uint8_t' does not name a type
C:\Users\marco\Documents\Arduino\libraries\RTClib-master/RTClib.h:42: error: expected `)' before 'seconds'
C:\Users\marco\Documents\Arduino\libraries\RTClib-master/RTClib.h:43: error: expected `)' before 'days'
C:\Users\marco\Documents\Arduino\libraries\RTClib-master/RTClib.h:45: error: 'int16_t' does not name a type
C:\Users\marco\Documents\Arduino\libraries\RTClib-master/RTClib.h:46: error: 'int8_t' does not name a type
C:\Users\marco\Documents\Arduino\libraries\RTClib-master/RTClib.h:47: error: 'int8_t' does not name a type
C:\Users\marco\Documents\Arduino\libraries\RTClib-master/RTClib.h:48: error: 'int8_t' does not name a type
C:\Users\marco\Documents\Arduino\libraries\RTClib-master/RTClib.h:49: error: 'int32_t' does not name a type
C:\Users\marco\Documents\Arduino\libraries\RTClib-master/RTClib.h:55: error: 'int32_t' does not name a type
C:\Users\marco\Documents\Arduino\libraries\RTClib-master/RTClib.h:63: error: 'uint8_t' does not name a type
C:\Users\marco\Documents\Arduino\libraries\RTClib-master/RTClib.h:65: error: 'uint8_t' does not name a type
C:\Users\marco\Documents\Arduino\libraries\RTClib-master/RTClib.h:69: error: 'uint8_t' does not name a type
C:\Users\marco\Documents\Arduino\libraries\RTClib-master/RTClib.h:70: error: 'uint8_t' has not been declared
C:\Users\marco\Documents\Arduino\libraries\RTClib-master/RTClib.h:70: error: 'uint8_t' has not been declared
C:\Users\marco\Documents\Arduino\libraries\RTClib-master/RTClib.h:70: error: 'uint8_t' has not been declared
C:\Users\marco\Documents\Arduino\libraries\RTClib-master/RTClib.h:71: error: 'uint8_t' has not been declared
C:\Users\marco\Documents\Arduino\libraries\RTClib-master/RTClib.h:71: error: 'uint8_t' has not been declared
C:\Users\marco\Documents\Arduino\libraries\RTClib-master/RTClib.h:72: error: 'uint8_t' has not been declared
C:\Users\marco\Documents\Arduino\libraries\RTClib-master/RTClib.h:72: error: 'uint8_t' has not been declared
C:\Users\marco\Documents\Arduino\libraries\RTClib-master/RTClib.h:72: error: 'uint8_t' has not been declared
sketch_jun07a_funz__rel_.ino: In function 'void loop()':
sketch_jun07a_funz__rel_:134: error: 'class DateTime' has no member named 'hour'
sketch_jun07a_funz__rel_:134: error: 'class DateTime' has no member named 'minute'
sketch_jun07a_funz__rel_:134: error: 'class DateTime' has no member named 'second'
sketch_jun07a_funz__rel_:138: error: 'class DateTime' has no member named 'day'
sketch_jun07a_funz__rel_:138: error: 'class DateTime' has no member named 'month'
sketch_jun07a_funz__rel_:138: error: 'class DateTime' has no member named 'year'
sketch_jun07a_funz__rel_:197: error: 'class DateTime' has no member named 'hour'
sketch_jun07a_funz__rel_:197: error: 'class DateTime' has no member named 'minute'
sketch_jun07a_funz__rel_:197: error: 'class DateTime' has no member named 'second'

cyberhs


marco3020

eccolo modificando libreria e la variabile rt: #
Code: [Select]



include <RTClib.h>



#include <PCF8574_HD44780_I2C.h>
#include <Wire.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#include <Wire.h>


RTC_DS1307 RTC;

PCF8574_HD44780_I2C lcd(0x3F, 20, 4);



int oraAlba = 9;
int minAlba = 10;
long albas;
int durataAlbas = 720;
int oraTramonto = 17;
int minTramonto = 10;
long tramontos;
int durataTramontos = 720;
long nows;
int delayR = 0;
int delayG = 120;
int delayB = 240;
int delayUV = 360;
int delayW = 360;

int pinR = 2;
int pinG = 3;
int pinB = 4;
int pinW = 5;
int pinUV = 6;

//rele
float rele1 = 35;
float rele2 = 37;
int   rele3 = 39;
float rele4 = 41;
int rele5 = 43;

char buffer1[20];
char buffer2[20];

float riscaldatore = 22.0; // allerta temperatura acqua bassa
float alertacqua = 26.0; // ventola tangenziale
float alertplafo = 44.0;  // alerta plafoniera temperatura troppo alta
float tempSoglia = 38.0; //temperatura ventole plafo

#define ONE_WIRE_BUS 7
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
DeviceAddress tmp_address;
float temp0=0;
float temp1=0;
int numberOfDevices;

#define VENTOLA 35
#define TANG 37
#define NOTTE 39
#define PUMP 41
#define PUMP1 43
#define RISC 45

void setup()
{

 
  lcd.init();           // LCD Initialization
  lcd.backlight( );      // Backlight ON
  lcd.clear();          // Clear the display

  numberOfDevices = 1;
 
  Serial.begin(9600);
  Wire.begin();


  sensors.begin();

  pinMode(pinR, OUTPUT);
  pinMode(pinG, OUTPUT);
  pinMode(pinB, OUTPUT);
  pinMode(pinW, OUTPUT);
  pinMode(pinUV, OUTPUT);

  pinMode(rele1, OUTPUT);
  pinMode(rele2, OUTPUT);
  pinMode(rele3, OUTPUT);
  pinMode(rele4, OUTPUT);
  pinMode(rele5, OUTPUT);
 
  pinMode(VENTOLA, OUTPUT);
  pinMode(TANG, OUTPUT);
 
  pinMode(RISC, OUTPUT);
  pinMode(NOTTE, OUTPUT);
  pinMode(PUMP, OUTPUT);
  pinMode(PUMP1, OUTPUT);
 
  digitalWrite( rele1, LOW );
  digitalWrite( rele2, LOW );
  digitalWrite( rele3, LOW );
  digitalWrite( rele4, LOW );
  digitalWrite(rele5, LOW);
 
///////////////////////////// SETTAGGIO ORA ////////////////////////////////////
 /*
Come settare correttamente ora:
1) compilare lo sketch con quella riga , a) oppure b)
2) flashare l'Arduino con quello sketch, in modo che lo sketch regoli l'RTC
3) ricompilare lo sketch SENZA quella riga
4) riflashare l'Arduino con il nuovo sketch

Ora puoi fare tutti gli stacchi che vuoi e l'RTC andrà per conto suo correttamente.*/


   
   RTC.adjust(DateTime(__DATE__, __TIME__)); // settaggio ora automatico b)
   //RTC.begin(DateTime(__DATE__, __TIME__));
/////////////////////////////////////////////////////////////////////////////////// 

delay(3000);
}



void loop() {

 
  // prendo ora attuale
  DateTime now = RTC.now();
  sprintf(buffer1,  "%02d:%02d:%02d", now.hour(), now.minute(), now.second());
  lcd.setCursor(0,0);
  lcd.print( buffer1 );
 
  sprintf(buffer2,  "%02d/%02d/%d", now.day(), now.month(), now.year());
  lcd.setCursor(0,1);
  lcd.print( buffer2 );
  Serial.println(buffer1);
  Serial.println(buffer2);

  // Richiesta temperatura
sensors.requestTemperatures(); // Comando per misurare la temp.
  temp0 = sensors.getTempCByIndex(0);
  lcd.setCursor(0,2); // Colonna 0, Riga 0
  lcd.print("acqua:");
  lcd.setCursor (6, 2);
  lcd.print(temp0);
 
  temp1 = sensors.getTempCByIndex(1);
  lcd.setCursor (0,3); //Colonna 0, Riga 1
  lcd.print("plafo:");
  lcd.setCursor (6,3);
  lcd.print(temp1);
 
 
 
//PLAFONIERA =TEMP1 vetole
 
  if (temp1 > tempSoglia - 0.2 and - 0.6 ) {
    digitalWrite(VENTOLA, LOW);
  }
  if (temp1  < tempSoglia + 0.2 and + 0.6) {
    digitalWrite(VENTOLA, HIGH);
    }

// ventola tangenziale
 
   if (temp0 > alertacqua - 0.1 and - 0.6) {
    digitalWrite(TANG, LOW);
   }
   if (temp0 < alertacqua + 0.1 and + 0.6) {
  digitalWrite(TANG, HIGH);
   }
// riscaldatore

if (temp0> riscaldatore + 1.0 and  +4.0 ) {
  digitalWrite (RISC, LOW);
}

if (temp0< riscaldatore - 1.0 and  - 4.0 ){
 digitalWrite (RISC, HIGH);

}

 
  // Calcolo inizio alba in secondi
  albas = oraAlba * 3600 + minAlba * 60;

  // Calcolo inizio tramonto in secondi
  tramontos = oraTramonto * 3600 + minTramonto * 60;


  // Calcolo attuale in secondi
  nows = now.hour() * 3600 + now.minute() * 60 + now.second();


  // Notte
  if (nows < albas || nows > tramontos + durataTramontos) {
   
    digitalWrite(pinR, LOW);
    digitalWrite(pinG, LOW);
    digitalWrite(pinB, LOW);
    digitalWrite(pinUV, LOW);
    digitalWrite(pinW, LOW);
   
    digitalWrite(NOTTE, HIGH);
    digitalWrite(PUMP, LOW);
    digitalWrite(PUMP1, HIGH);

}

  // Alba
  if (nows > albas && nows + delayR < albas + durataAlbas) {
    analogWrite(pinR, 65 * (float)(((albas + durataAlbas) - nows) / (durataAlbas - delayR)));
  }
  if (nows > albas && nows + delayG < albas + durataAlbas) {
    analogWrite(pinG, 65 * (float)(((albas + durataAlbas) - nows) / (durataAlbas - delayG)));
  }
  if (nows > albas && nows + delayB < albas + durataAlbas) {
    analogWrite(pinB, 65 * (float)(((albas + durataAlbas) - nows) / (durataAlbas - delayB)));
  }
  if (nows > albas && nows + delayUV < albas + durataAlbas) {
    analogWrite(pinUV, 65 * (float)(((albas + durataAlbas) - nows) / (durataAlbas - delayUV)));
  }
  if (nows > albas && nows + delayW < albas + durataAlbas) {
    analogWrite(pinW, 65 * (float)(((albas + durataAlbas) - nows) / (durataAlbas - delayW)));
  }

  // Giorno
  if (nows > albas + durataAlbas && nows < tramontos) {
    digitalWrite(pinR, HIGH);
    digitalWrite(pinG, HIGH);
    digitalWrite(pinB, HIGH);
    digitalWrite(pinUV, HIGH);
    digitalWrite(pinW, HIGH);
    digitalWrite(PUMP,HIGH);
    digitalWrite (PUMP1,LOW);

}

 
   if ( temp1 > alertplafo + 0.2 and + 0.6 ) {
   digitalWrite(pinR, LOW);
   digitalWrite(pinG, LOW);
   digitalWrite(pinB, LOW);
   digitalWrite(pinUV, LOW);
   digitalWrite(pinW, LOW);
   

   
 
}
 
  // Tramonto
  if (nows > tramontos && nows + delayR < tramontos + durataTramontos) {
    int v = 65 - (65 * (float)(((tramontos + durataTramontos) - nows) / (durataTramontos - delayR)));
    analogWrite(pinR, v);
  }
  if (nows > tramontos && nows + delayG < tramontos + durataTramontos) {
    int v = 65 - (65 * (float)(((tramontos + durataTramontos) - nows) / (durataTramontos - delayG)));
    analogWrite(pinG, v);
  }
  if (nows > tramontos && nows + delayB < tramontos + durataTramontos) {
    int v = 65 - (65 * (float)(((tramontos + durataTramontos) - nows) / (durataTramontos - delayB)));
    analogWrite(pinB, v);
  }
  if (nows > tramontos && nows + delayUV < tramontos + durataTramontos) {
    int v = 65 - (65 * (float)(((tramontos + durataTramontos) - nows) / (durataTramontos - delayUV)));
    analogWrite(pinUV, v);
  }
  if (nows > tramontos && nows + delayW < tramontos + durataTramontos) {
    int v = 65 - (65 * (float)(((tramontos + durataTramontos) - nows) / (durataTramontos - delayW)));
    analogWrite(pinW, v);
  }

  }

cyberhs

Ma hai scaricato la libreria completa (RTClib.h, RTClib.cpp, keywords.txt, ecc.) e cancellato quella vecchia?

Io la uso da parecchio senza alcun problema.

Go Up