Outils pour utilisateurs

Outils du site


start:esp32:max7219:horloge

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
start:esp32:max7219:horloge [2026/08/22 17:02] – [ESP32 Max7219 horloge] adminstart:esp32:max7219:horloge [2026/08/22 17:37] (Version actuelle) – [exemples Programmes Horloge] admin
Ligne 2: Ligne 2:
  
 {{ :start:esp32:max7219:capture_d_ecran_du_2026-08-19_18-43-36.png?direct&600 |}} {{ :start:esp32:max7219:capture_d_ecran_du_2026-08-19_18-43-36.png?direct&600 |}}
 +==== exemples Programmes Horloge ====
 <code c horloge002.ino> <code c horloge002.ino>
 //  makerguides.com: synchronizing ESP32 time with SNTP server //  makerguides.com: synchronizing ESP32 time with SNTP server
Ligne 23: Ligne 23:
  
  
-const char* ssid = "castellab"; +const char* ssid = "---------"; 
-const char* password = "Castel37110$";+const char* password = "-----------";
  
 // https://github.com/nayarsystems/posix_tz_db/blob/master/zones.csv // https://github.com/nayarsystems/posix_tz_db/blob/master/zones.csv
 +//const char *timezone = "AEST-10AEDT,M10.1.0,M4.1.0/3"; //Sydney Australie
 const char *timezone = "CET-1CEST,M3.5.0,M10.5.0/3";//PARIS const char *timezone = "CET-1CEST,M3.5.0,M10.5.0/3";//PARIS
  
Ligne 63: Ligne 63:
 void obtainTime() { void obtainTime() {
   // https://cplusplus.com/reference/ctime/tm/   // https://cplusplus.com/reference/ctime/tm/
-  char buff[24];+  char buff1[4]; 
 +  char buff2[4];
   struct tm t;   struct tm t;
   getLocalTime(&t);     getLocalTime(&t);  
-  sprintf(buff, "%02d:%02d", t.tm_hour, t.tm_min); +  sprintf(buff1, "%02d", t.tm_hour); 
-  Serial.println("Heure, Minutes"); +  sprintf(buff2,"%02d" , t.tm_min); 
-  Serial.println(buff); +  Serial.println("Heures"); 
-  Serial.print(t.tm_hour, t.tm_min); +  Serial.println(buff1); 
-  heure = t.tm_hour+   Serial.println("Minutes"); 
-  minute = t.tm_min;+  Serial.println(buff2); 
 +  heure = buff1
 +  minute = buff2;
   Time = heure +":"+ minute;   Time = heure +":"+ minute;
-  Serial.println(Time); 
   Display. setTextAlignment(PA_CENTER);   Display. setTextAlignment(PA_CENTER);
   Display.print(Time);   Display.print(Time);
- +}
-  }+
  
 void setup()  void setup() 
Ligne 96: Ligne 97:
   delay(1000);   delay(1000);
 } }
 +
 </code> </code>
  
/home/chanteri/www/fablab37110/data/attic/start/esp32/max7219/horloge.1787410967.txt.gz · Dernière modification : de admin