MAJ commentaires de code et TODO Liste dans le readme
This commit is contained in:
parent
55ca79e431
commit
deedda25b8
@ -27,17 +27,20 @@ RTC_DS1307 rtc;
|
|||||||
//
|
//
|
||||||
void syncNTPtoRTC(){
|
void syncNTPtoRTC(){
|
||||||
|
|
||||||
|
//// Récupération du temps Internet par NTP
|
||||||
Serial.println ("Routine de synchro NTP vers RTC :");
|
Serial.println ("Routine de synchro NTP vers RTC :");
|
||||||
Serial.print ("- récupération du temps Internet : ");
|
Serial.print ("- récupération du temps Internet : ");
|
||||||
ntp.update(); // récupération du temps NTP
|
ntp.update(); // récupération du temps NTP
|
||||||
Serial.println(ntp.formattedTime("%T")); // hh:mm:ss
|
Serial.println(ntp.formattedTime("%T")); // hh:mm:ss
|
||||||
|
|
||||||
|
//// Mise à jour du temps RTC de l'horloge locale
|
||||||
Serial.print ( "- enregistrement du temps Internet dans l'horlore RTC" );
|
Serial.print ( "- enregistrement du temps Internet dans l'horlore RTC" );
|
||||||
rtc.adjust(DateTime(ntp.year(), ntp.month(), ntp.day(), ntp.hours(), ntp.minutes(), ntp.seconds()));
|
rtc.adjust(DateTime(ntp.year(), ntp.month(), ntp.day(), ntp.hours(), ntp.minutes(), ntp.seconds()));
|
||||||
Serial.println ( " : OK." );
|
Serial.println ( " : OK." );
|
||||||
Serial.print ( "Maintenant l'horloge interne indique : " );
|
|
||||||
|
|
||||||
|
//// Affichage du temps RTC en console série pour débug
|
||||||
DateTime now = rtc.now();
|
DateTime now = rtc.now();
|
||||||
|
Serial.print ( "Maintenant l'horloge interne indique : " );
|
||||||
Serial.print(daysOfTheWeek[now.dayOfTheWeek()]);
|
Serial.print(daysOfTheWeek[now.dayOfTheWeek()]);
|
||||||
Serial.print(" ");
|
Serial.print(" ");
|
||||||
Serial.print(now.day(), DEC);
|
Serial.print(now.day(), DEC);
|
||||||
@ -83,6 +86,7 @@ void setup () {
|
|||||||
ntp.update();
|
ntp.update();
|
||||||
Serial.println(ntp.formattedTime("%A %d/%m/%Y, il est : %T")); // www dd/mm/yyyy hh:mm:ss
|
Serial.println(ntp.formattedTime("%A %d/%m/%Y, il est : %T")); // www dd/mm/yyyy hh:mm:ss
|
||||||
|
|
||||||
|
//// Initialisation RTC
|
||||||
Serial.print("Initialisation RTC");
|
Serial.print("Initialisation RTC");
|
||||||
if (! rtc.begin()) {
|
if (! rtc.begin()) {
|
||||||
Wire.begin(I2C_SDA,I2C_SCL); // Broches (SDA,SCL) de l'I2C pour la RTC
|
Wire.begin(I2C_SDA,I2C_SCL); // Broches (SDA,SCL) de l'I2C pour la RTC
|
||||||
@ -94,14 +98,14 @@ void setup () {
|
|||||||
}
|
}
|
||||||
Serial.println (" : OK");
|
Serial.println (" : OK");
|
||||||
|
|
||||||
syncNTPtoRTC();
|
syncNTPtoRTC(); // Mise à l'heure de l'horloge RTC locale avec l'heure Internet
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////
|
||||||
|
|
||||||
void loop () {
|
void loop () {
|
||||||
|
|
||||||
Serial.println("Rien");
|
Serial.print("Rien ");
|
||||||
delay(10000);
|
delay(10000);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
24
README.md
24
README.md
@ -1,3 +1,23 @@
|
|||||||
Firmware ESP32 pour mon horloge Nixie
|
Firmware ~~ESP32~~ actuellement ESP8266 pour mon horloge Nixie
|
||||||
|
sera migré sur ESP32 plus tard
|
||||||
|
|
||||||
Utilise les librairies : wifi, NTPClient, WiFiUdp
|
## Librairies utilisées :
|
||||||
|
- ESP8266WiFi
|
||||||
|
- WiFiUdp
|
||||||
|
- RTClib (https://github.com/adafruit/RTClib)
|
||||||
|
- NTP (https://github.com/sstaub/NTP)
|
||||||
|
|
||||||
|
## Personnalisation :
|
||||||
|
Personnalisez le fichier 'secrets.h.default' avec vos identifiants de connexion WiFi
|
||||||
|
et renommez-le en 'secrets.h'
|
||||||
|
|
||||||
|
## TODO :
|
||||||
|
Gestion des erreurs
|
||||||
|
- [ ] WiFi : utiliser le Wifi Manager https://github.com/tzapu/WiFiManager
|
||||||
|
- [ ] NTP : en cas d'echec de récupération du temps Internet
|
||||||
|
Ajouts de fonctionnalités
|
||||||
|
- [ ] affichage de l'heure sur Nixie
|
||||||
|
- [ ] ajustement de l'heure par encodeur rotatif
|
||||||
|
- [ ] alarme réveil par buzer/HP ?
|
||||||
|
- [ ]
|
||||||
|
- [ ]
|
Loading…
x
Reference in New Issue
Block a user