ajout clignotement des secondes sur Nixie3
This commit is contained in:
parent
124b05be2d
commit
268be2953b
@ -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
|
unsigned long LastNixieUpdate; // le temps de dernière MAJ affichage Nixie
|
||||||
int heu_d, heu_u, min_d, min_u, sec_d, sec_u;
|
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 intervalRTCUpdate = 3600000; // 86400000 = 24 heures / 3600000 = 1 heure
|
||||||
const long intervalNixieUpdate = 1000; // 1000 = 1 seconde
|
const long intervalNixieUpdate = 2000; // 1000 = 1 seconde
|
||||||
|
|
||||||
WiFiUDP wifiUdp;
|
WiFiUDP wifiUdp;
|
||||||
NTP ntp(wifiUdp);
|
NTP ntp(wifiUdp);
|
||||||
@ -100,16 +100,16 @@ void printRTC(){
|
|||||||
|
|
||||||
void initNTP(){
|
void initNTP(){
|
||||||
|
|
||||||
// Paramétrage NTP avec prise en compte de l'heure d'été pour la France
|
// Paramétrage NTP avec prise en compte de l'heure d'été pour la France
|
||||||
Serial.print("Initialisation NTP");
|
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.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.ruleSTD("CET", Last, Sun, Oct, 3, 60); // last sunday in october 3:00, timezone +60min (+1 GMT)
|
||||||
ntp.begin();
|
ntp.begin();
|
||||||
Serial.println(" : OK");
|
Serial.println(" : OK");
|
||||||
//ntp.updateInterval(1000); // update every second
|
//ntp.updateInterval(1000); // update every second
|
||||||
Serial.print("Le temps Internet (NTP) indique : ");
|
Serial.print("Le temps Internet (NTP) indique : ");
|
||||||
ntp.update();
|
ntp.update();
|
||||||
Serial.println(ntp.formattedTime("%A %d/%m/%Y %T")); // www dd/mm/yyyy hh:mm:ss
|
Serial.println(ntp.formattedTime("%A %d/%m/%Y %T")); // www dd/mm/yyyy hh:mm:ss
|
||||||
}
|
}
|
||||||
|
|
||||||
void syncNTPtoRTC(){
|
void syncNTPtoRTC(){
|
||||||
@ -191,6 +191,15 @@ void loop () {
|
|||||||
sec_u = (now.second())%10;
|
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);
|
printNixie1(heu_d);
|
||||||
delay(5);
|
delay(5);
|
||||||
|
11
hardware.h
11
hardware.h
@ -5,16 +5,19 @@
|
|||||||
#define I2C_SCL 41
|
#define I2C_SCL 41
|
||||||
|
|
||||||
// Sorties BCD vers Nixie
|
// Sorties BCD vers Nixie
|
||||||
#define BCD_A 9
|
#define BCD_A 11
|
||||||
#define BCD_B 10
|
#define BCD_B 12
|
||||||
#define BCD_C 11
|
#define BCD_C 13
|
||||||
#define BCD_D 12
|
#define BCD_D 14
|
||||||
|
|
||||||
#define NX1A 4
|
#define NX1A 4
|
||||||
#define NX2A 5
|
#define NX2A 5
|
||||||
#define NX3A 6
|
#define NX3A 6
|
||||||
#define NX4A 7
|
#define NX4A 7
|
||||||
|
|
||||||
|
// sortie pilotage des LEDs WS2812B placées sous les Nixies
|
||||||
|
#define OUT_LEDs 43
|
||||||
|
|
||||||
|
|
||||||
// Touches
|
// Touches
|
||||||
#define Rotary_A 35
|
#define Rotary_A 35
|
||||||
|
Loading…
x
Reference in New Issue
Block a user