Hello, I'm a french studient in a technologic section and I have problem using a RTC (RealTime Clock) with Arduino, I verified many times how to do and I can't understand what's wrong. I also use the EEPROM of Arduino and I don't know if my program is working (I mean I verified but didn't test it on the board).
Here it is:
#include <EEPROM.h>
#include <SPI.h>
#include "RTClib.h"
#include "DS1307.h"
int Vchaleurint = 7;
int Vchaleurext = 4;
int Vlumi = 1;
int Vhumi = 11;
int Time = 13;
void setup () {
Serial.begin(9600); //intialise le moniteur série
rtc.begin(DateTime(__DATE__,__TIME__)); //initialise le module RTC
}
void loop () {
DateTime now = RTC.now(); // récupère les données(temps) du module RTC et on le stocke dans now
if (Time.now >= 4){
{int Vchaleurint = analogRead (7)/4; //doit être divisée car ne peut lire une valeur supérieure à 255 et est à 1023
EEPROM.write (7, val); //écrit sur le registre la valeur reçue
value = EEPROM.read(7); //lit la valeur reçue
Serial.print(7); //écrit la valeur lue afin de l'enregistrer
Serial.print("\t");
Serial.print(value, DEC); //met la valeur en décimal
Serial.println(); //l'affiche sur le moniteur série
int Vchaleurext = analogRead (4)/4;
EEPROM.write (4, val);
value = EEPROM.read(4);
Serial.print(4);
Serial.print("\t");
Serial.print(value, DEC);
Serial.println();
int Vlumi = analogRead (1)/4;
EEPROM.write (1, val);
value = EEPROM.read(0);
Serial.print(1);
Serial.print("\t");
Serial.print(value, DEC);
Serial.println();
int Vhumi = analogRead (11)/4;
EEPROM.write (11, val);
value = EEPROM.read(0);
Serial.print(11);
Serial.print("\t");
Serial.print(value, DEC);
Serial.println();
//intégrer code Noé
}
}
if (Time.now == 22){
Wire.endTransimission(stop)
}
}
Thank you for answering.
DS1307.h (1.35 KB)
RTC_hive2.ino (1.02 KB)
RTClib.h (4.74 KB)