ajout clignotement des secondes sur Nixie3

This commit is contained in:
Laurent Claude 2023-08-04 21:10:41 +02:00
parent 124b05be2d
commit 268be2953b
2 changed files with 28 additions and 16 deletions

View File

@ -22,8 +22,8 @@ unsigned long LastRTCUpdate; // le temps de dernière MAJ de l'horloge intern
unsigned long LastNixieUpdate; // le temps de dernière MAJ affichage Nixie
int heu_d, heu_u, min_d, min_u, sec_d, sec_u;
const long intervalRTCUpdate = 17000; // 86400000 = 24 heures - 3600000 = 1 heure
const long intervalNixieUpdate = 1000; // 1000 = 1 seconde
const long intervalRTCUpdate = 3600000; // 86400000 = 24 heures / 3600000 = 1 heure
const long intervalNixieUpdate = 2000; // 1000 = 1 seconde
WiFiUDP wifiUdp;
NTP ntp(wifiUdp);
@ -100,16 +100,16 @@ void printRTC(){
void initNTP(){
// Paramétrage NTP avec prise en compte de l'heure d'été pour la France
Serial.print("Initialisation NTP");
ntp.ruleDST("CEST", Last, Sun, Mar, 2, 120); // last sunday in march 2:00, timetone +120min (+1 GMT + 1h summertime offset)
ntp.ruleSTD("CET", Last, Sun, Oct, 3, 60); // last sunday in october 3:00, timezone +60min (+1 GMT)
ntp.begin();
Serial.println(" : OK");
//ntp.updateInterval(1000); // update every second
Serial.print("Le temps Internet (NTP) indique : ");
ntp.update();
Serial.println(ntp.formattedTime("%A %d/%m/%Y %T")); // www dd/mm/yyyy hh:mm:ss
// Paramétrage NTP avec prise en compte de l'heure d'été pour la France
Serial.print("Initialisation NTP");
ntp.ruleDST("CEST", Last, Sun, Mar, 2, 120); // last sunday in march 2:00, timetone +120min (+1 GMT + 1h summertime offset)
ntp.ruleSTD("CET", Last, Sun, Oct, 3, 60); // last sunday in october 3:00, timezone +60min (+1 GMT)
ntp.begin();
Serial.println(" : OK");
//ntp.updateInterval(1000); // update every second
Serial.print("Le temps Internet (NTP) indique : ");
ntp.update();
Serial.println(ntp.formattedTime("%A %d/%m/%Y %T")); // www dd/mm/yyyy hh:mm:ss
}
void syncNTPtoRTC(){
@ -191,6 +191,15 @@ void loop () {
sec_u = (now.second())%10;
}
// allumage du point une demi-seconde par seconde
// utilisation du digit "9" du Nixie 3 (dizaines de minutes)
if (currentMillis - LastNixieUpdate < 1000) {
printNixie3(9);
delay(5);
digitalWrite(NX3A, 0); //Switch OFF Anode Nixie 1
} else {
delay(5);
}
printNixie1(heu_d);
delay(5);

View File

@ -5,16 +5,19 @@
#define I2C_SCL 41
// Sorties BCD vers Nixie
#define BCD_A 9
#define BCD_B 10
#define BCD_C 11
#define BCD_D 12
#define BCD_A 11
#define BCD_B 12
#define BCD_C 13
#define BCD_D 14
#define NX1A 4
#define NX2A 5
#define NX3A 6
#define NX4A 7
// sortie pilotage des LEDs WS2812B placées sous les Nixies
#define OUT_LEDs 43
// Touches
#define Rotary_A 35