rtc

Dependents:   programme_final

Revision:
2:7ace46b4f4f3
Parent:
1:2babe1d342dc
Child:
3:195aa91ec748
--- a/Ecran.cpp	Fri Oct 14 11:55:53 2016 +0000
+++ b/Ecran.cpp	Sun Oct 23 17:43:04 2016 +0000
@@ -9,7 +9,12 @@
 
 
 ///////////////////////////// AFFICHAGE_DES_ECRANS////////////////////////////////////////////
- 
+  AnalogIn Vpan(A0);
+    AnalogIn Ipan(A1);
+    AnalogIn Tpan(A2);
+    AnalogIn Irr(A3);
+    AnalogIn Vbat(A4);
+    AnalogIn Ibat(A5);
  
  void horloge();
 char jour[6];   
@@ -18,6 +23,15 @@
 char heure[6];   
 char minute[6];
 char seconde[6]; 
+char date [60];
+char Vpan1 [3];
+unsigned int day =00;
+unsigned int month =00;
+unsigned int year=2000;
+unsigned int hour =00;
+unsigned int min =00;
+unsigned int sec=00;
+
 
 //////////////////premier ecran///////////////////////
 void principal()
@@ -90,10 +104,49 @@
           lcd.SetBackColor(LCD_COLOR_DARKRED);
           lcd.SetTextColor(LCD_COLOR_WHITE); 
           lcd.DisplayStringAt(30, LINE(9), (uint8_t *)"BACK", LEFT_MODE);
-    
+   //AFFICHAGE DU BOUTON POUR VISUALISER la date
+            lcd.SetBackColor(LCD_COLOR_BLACK);
+            lcd.SetTextColor(LCD_COLOR_WHITE);
+            lcd.DisplayStringAt(400,0 , (uint8_t *)"TIME", LEFT_MODE);
         }
   
- void EcranUtilis()
+ void EcranUtilis_ok()
+        {
+          lcd.Clear(LCD_COLOR_DARKGRAY);
+          lcd.SetBackColor(LCD_COLOR_DARKGRAY);
+          lcd.SetTextColor(LCD_COLOR_YELLOW);
+          lcd.DisplayStringAt(0, LINE(1), (uint8_t *)"THE DATA DISPLAY", CENTER_MODE);
+          
+//AFFICHAGE DU BOUTON POUR AFFICHAGER LES DONNEES ARRIVEES SUR LA CARTE    
+         lcd.SetTextColor(LCD_COLOR_GREEN);
+          lcd.FillRect(25, 75, 180, 30);
+          lcd.FillRect(245, 75, 180,30);
+          lcd.FillRect(25, 115, 180, 30);
+          lcd.FillRect(245, 115, 180,30);
+          lcd.FillRect(25, 155, 180, 30);
+          lcd.FillRect(245, 155, 180,30);
+    lcd.SetBackColor(LCD_COLOR_GREEN);    
+          lcd.SetTextColor(LCD_COLOR_WHITE);
+          lcd.DisplayStringAt(30,80, (uint8_t *)" Ipanneau", LEFT_MODE);
+          lcd.DisplayStringAt(250, 80, (uint8_t *)"Vpanneau", LEFT_MODE);   
+          lcd.DisplayStringAt(30,120, (uint8_t *)" Tpanneau", LEFT_MODE);
+          lcd.DisplayStringAt(250, 120, (uint8_t *)"Iradiation", LEFT_MODE);
+          lcd.DisplayStringAt(30, 160, (uint8_t *)"Vbatterie ", LEFT_MODE);
+          lcd.DisplayStringAt(250, 160, (uint8_t *)"Ibatterie", LEFT_MODE);
+          
+  //AFFICHAGE DU BOUTON RETOUR       
+          lcd.SetTextColor(LCD_COLOR_DARKRED);
+          lcd.FillRect(30, 210, 80,30);
+          lcd.SetBackColor(LCD_COLOR_DARKRED);
+          lcd.SetTextColor(LCD_COLOR_WHITE); 
+          lcd.DisplayStringAt(30, LINE(9), (uint8_t *)"BACK", LEFT_MODE);
+         //AFFICHAGE DU BOUTON POUR VISUALISER la date
+            lcd.SetBackColor(LCD_COLOR_BLACK);
+            lcd.SetTextColor(LCD_COLOR_WHITE);
+            lcd.DisplayStringAt(400,0 , (uint8_t *)"TIME", LEFT_MODE);
+    }
+    
+    void EcranUtilis_fail()
         {
           lcd.Clear(LCD_COLOR_DARKGRAY);
           lcd.SetBackColor(LCD_COLOR_DARKGRAY);
@@ -101,55 +154,94 @@
           lcd.DisplayStringAt(0, LINE(1), (uint8_t *)"THE DATA DISPLAY", CENTER_MODE);
           
 //AFFICHAGE DU BOUTON POUR AFFICHAGER LES DONNEES ARRIVEES SUR LA CARTE    
-           lcd.SetBackColor(LCD_COLOR_WHITE);
-          lcd.SetTextColor(LCD_COLOR_BLACK);
-      
+         lcd.SetTextColor(LCD_COLOR_RED);
+          lcd.FillRect(25, 75, 180, 30);
+          lcd.FillRect(245, 75, 180,30);
+          lcd.FillRect(25, 115, 180, 30);
+          lcd.FillRect(245, 115, 180,30);
+          lcd.FillRect(25, 155, 180, 30);
+          lcd.FillRect(245, 155, 180,30);
+    lcd.SetBackColor(LCD_COLOR_RED);    
+          lcd.SetTextColor(LCD_COLOR_WHITE);
+          lcd.DisplayStringAt(30,80, (uint8_t *)" Ipanneau", LEFT_MODE);
+          lcd.DisplayStringAt(250, 80, (uint8_t *)"Vpanneau", LEFT_MODE);   
+          lcd.DisplayStringAt(30,120, (uint8_t *)" Tpanneau", LEFT_MODE);
+          lcd.DisplayStringAt(250, 120, (uint8_t *)"Iradiation", LEFT_MODE);
+          lcd.DisplayStringAt(30, 160, (uint8_t *)"Vbatterie ", LEFT_MODE);
+          lcd.DisplayStringAt(250, 160, (uint8_t *)"Ibatterie", LEFT_MODE);
+          
   //AFFICHAGE DU BOUTON RETOUR       
-          lcd.SetTextColor(LCD_COLOR_RED);
+          lcd.SetTextColor(LCD_COLOR_DARKRED);
           lcd.FillRect(30, 210, 80,30);
-          lcd.SetBackColor(LCD_COLOR_RED);
+          lcd.SetBackColor(LCD_COLOR_DARKRED);
           lcd.SetTextColor(LCD_COLOR_WHITE); 
           lcd.DisplayStringAt(30, LINE(9), (uint8_t *)"BACK", LEFT_MODE);
+          //AFFICHAGE DU BOUTON POUR VISUALISER la date
+            lcd.SetBackColor(LCD_COLOR_BLACK);
+            lcd.SetTextColor(LCD_COLOR_WHITE);
+            lcd.DisplayStringAt(400,0 , (uint8_t *)"TIME", LEFT_MODE);
     }
  ///////FONCTION QUI AFFICHE LE NOUVEL ECRAN APRES L'APPUIE DE SUR TIME DATE 
 
 
         void Ecran2()
          {
+           DS1338 ds1338(D14,D15);
            struct tm time;
-           time.tm_sec=0;
-           time.tm_min=0;
-           time.tm_hour=14;
-           time.tm_mday=10;
-           time.tm_year=116;
-           time.tm_mon=0;
-           time.tm_wday=2;
-           time.tm_yday=0;
-           time.tm_isdst=0;
-          lcd.Clear(LCD_COLOR_WHITE);
+           
+           
+        lcd.Clear(LCD_COLOR_WHITE);
           lcd.SetTextColor(LCD_COLOR_BLACK);
           lcd.SetBackColor(LCD_COLOR_WHITE); 
           
           lcd.DisplayStringAt(30, LINE(2), (uint8_t *)"DATE:", LEFT_MODE);
-          sprintf(jour,"%02d",time.tm_mday);
+          sprintf((char*)jour,"%02d",time.tm_mday);
           lcd.DisplayStringAt(30, 82, (uint8_t *)jour, LEFT_MODE);
           lcd.DisplayStringAt(65, 82, (uint8_t *)"/", LEFT_MODE);
-          sprintf(mois,"%02d",time.tm_mon);
+          sprintf((char*)mois,"%02d",time.tm_mon);
           lcd.DisplayStringAt(80, 82, (uint8_t *) mois, LEFT_MODE);
           lcd.DisplayStringAt(115, 82, (uint8_t *)"/", LEFT_MODE);
-          sprintf(annee,"%04d",time.tm_year);
+          sprintf((char*)annee,"%04d",time.tm_year);
           lcd.DisplayStringAt(130, 82, (uint8_t *)annee, LEFT_MODE);
           
           lcd.DisplayStringAt(30, 135, (uint8_t *)"TIME:", LEFT_MODE);
-          sprintf(heure,"%02d",time.tm_hour);
+          sprintf((char*)heure,"%02d",time.tm_hour);
           lcd.DisplayStringAt(30, 164, (uint8_t *)heure, LEFT_MODE);
           lcd.DisplayStringAt(65, 164, (uint8_t *)":", LEFT_MODE);
-          sprintf(minute,"%02d",time.tm_min);
+          sprintf((char*)minute,"%02d",time.tm_min);
           lcd.DisplayStringAt(80, 164, (uint8_t *)minute, LEFT_MODE);
           lcd.DisplayStringAt(115, 164, (uint8_t *)":", LEFT_MODE);
-          sprintf(seconde,"%02d",time.tm_sec);
+          sprintf((char*)seconde,"%02d",time.tm_sec);
           lcd.DisplayStringAt(130, 164, (uint8_t *)seconde, LEFT_MODE);
-                 
+              
+ 
+  //AFFICHAGE DU BOUTON QUITTER              
+          lcd.SetTextColor(LCD_COLOR_DARKRED);
+          lcd.FillRect(30, 210, 80,30);
+          lcd.SetBackColor(LCD_COLOR_DARKRED);
+          lcd.SetTextColor(LCD_COLOR_WHITE); 
+          lcd.DisplayStringAt(30,LINE(9), (uint8_t *)"BACK", LEFT_MODE);
+         
+  }
+  
+  void reg_time(){
+       struct tm time;
+       int i=0;
+      while (true) {
+        
+        DS1338 ds1338(D14,D15);
+        lcd.SetTextColor(LCD_COLOR_WHITE);
+        sprintf((char*)date, "%s", asctime(&time));
+        lcd.DisplayStringAt(0, LINE(1), (uint8_t *)date, LEFT_MODE);
+        
+       // sprintf((char*)date, "Touches: %s",time.tm_mday);
+        wait(0.5);
+        ds1338.readTime(&time);
+        
+        lcd.Clear(LCD_COLOR_WHITE);
+          lcd.SetTextColor(LCD_COLOR_BLACK);
+          lcd.SetBackColor(LCD_COLOR_WHITE); 
+          
 
   //AFFICHAGE DU BOUTON QUITTER              
           lcd.SetTextColor(LCD_COLOR_DARKRED);
@@ -157,47 +249,40 @@
           lcd.SetBackColor(LCD_COLOR_DARKRED);
           lcd.SetTextColor(LCD_COLOR_WHITE); 
           lcd.DisplayStringAt(30,LINE(9), (uint8_t *)"BACK", LEFT_MODE);
-           
-  }
+          if(i++==10)
+          break;
+          
+   }        }
   
   void Ecran2_Day()
           {
-              struct tm time;
-              time.tm_sec=0;
-           time.tm_min=28;
-           time.tm_hour=14;
-           time.tm_mday=10;
-           time.tm_year=116;
-           time.tm_mon=0;
-           time.tm_wday=2;
-           time.tm_yday=0;
-           time.tm_isdst=0;
-          lcd.Clear(LCD_COLOR_WHITE);
+                struct tm time;
+               lcd.Clear(LCD_COLOR_WHITE);
           lcd.SetBackColor(LCD_COLOR_WHITE); 
           lcd.SetTextColor(LCD_COLOR_BLACK);
           lcd.DisplayStringAt(30, LINE(2), (uint8_t *)"DATE:", LEFT_MODE);
           lcd.DisplayStringAt(65, 82, (uint8_t *)"/", LEFT_MODE);
-          sprintf(mois,"%02d",time.tm_mon);
+          sprintf((char*)mois,"%02d",time.tm_mon);
           lcd.DisplayStringAt(80, 82, (uint8_t *) mois, LEFT_MODE);
           lcd.DisplayStringAt(115, 82, (uint8_t *)"/", LEFT_MODE);
-          sprintf(annee,"%04d",time.tm_year);
+          sprintf((char*)annee,"%04d",time.tm_year);
           lcd.DisplayStringAt(130, 82, (uint8_t *)annee, LEFT_MODE);
           
           lcd.DisplayStringAt(30, 135, (uint8_t *)"TIME:", LEFT_MODE);
-          sprintf(heure,"%02d",time.tm_hour);
+          sprintf((char*)heure,"%02d",time.tm_hour);
           lcd.DisplayStringAt(30, 164, (uint8_t *)heure, LEFT_MODE);
           lcd.DisplayStringAt(65, 164, (uint8_t *)":", LEFT_MODE);
-          sprintf(minute,"%02d",time.tm_min);
+          sprintf((char*)minute,"%02d",time.tm_min);
           lcd.DisplayStringAt(80, 164, (uint8_t *)minute, LEFT_MODE);
           lcd.DisplayStringAt(115, 164, (uint8_t *)":", LEFT_MODE);
-          sprintf(seconde,"%02d ",time.tm_sec);
+          sprintf((char*)seconde,"%02d ",time.tm_sec);
           lcd.DisplayStringAt(130, 164, (uint8_t *)seconde, LEFT_MODE);
           
           lcd.SetBackColor(LCD_COLOR_BLUE);  
-          sprintf(jour,"%02d",time.tm_mday);
+          sprintf((char*)jour,"%02d",time.tm_mday);
           lcd.DisplayStringAt(30, 82, (uint8_t *)jour, LEFT_MODE);
-
-
+ 
+ 
           
  //AFFICHAGE DU BOUTON POUR AUGMENTER   
           lcd.SetTextColor(LCD_COLOR_DARKBLUE);
@@ -213,7 +298,7 @@
           lcd.SetBackColor(LCD_COLOR_DARKMAGENTA);
           lcd.SetTextColor(LCD_COLOR_WHITE);
           lcd.DisplayStringAt(245, LINE(9), (uint8_t *)"  + ", LEFT_MODE);
-
+ 
 //AFFICHAGE DU BOUTON OK            
           lcd.SetTextColor(LCD_COLOR_DARKGREEN);
           lcd.FillRect(360, 210, 80,30);
@@ -221,45 +306,36 @@
           lcd.SetTextColor(LCD_COLOR_WHITE);
           lcd.DisplayStringAt(360, LINE(9), (uint8_t *)" OK ", LEFT_MODE); 
            
+           
           }
           
   void Ecran2_Month()
           {
               struct tm time;
-              time.tm_sec=0;
-           time.tm_min=28;
-           time.tm_hour=14;
-           time.tm_mday=10;
-           time.tm_year=116;
-           time.tm_mon=0;
-           time.tm_wday=2;
-           time.tm_yday=0;
-           time.tm_isdst=0;
-          lcd.Clear(LCD_COLOR_WHITE);
+              lcd.Clear(LCD_COLOR_WHITE);
           lcd.SetTextColor(LCD_COLOR_BLACK);
           lcd.SetBackColor(LCD_COLOR_WHITE); 
           lcd.DisplayStringAt(30, LINE(2), (uint8_t *)"DATE:", LEFT_MODE);
-          sprintf(jour,"%02d",time.tm_mday);
+          sprintf((char*)jour,"%02d",time.tm_mday);
           lcd.DisplayStringAt(30, 82, (uint8_t *)jour, LEFT_MODE);
           lcd.DisplayStringAt(65, 82, (uint8_t *)"/", LEFT_MODE);
           lcd.DisplayStringAt(115, 82, (uint8_t *)"/", LEFT_MODE);
-          sprintf(annee,"%04d",time.tm_year);
+          sprintf((char*)annee,"%04d",time.tm_year);
           lcd.DisplayStringAt(130, 82, (uint8_t *)annee, LEFT_MODE);
           lcd.DisplayStringAt(30, 135, (uint8_t *)"TIME:", LEFT_MODE);
-          sprintf(heure,"%02d",time.tm_hour);
+          sprintf((char*)heure,"%02d",time.tm_hour);
           lcd.DisplayStringAt(30, 164, (uint8_t *)heure, LEFT_MODE);
           lcd.DisplayStringAt(65, 164, (uint8_t *)":", LEFT_MODE);
-          sprintf(minute,"%02d",time.tm_min);
+          sprintf((char*)minute,"%02d",time.tm_min);
           lcd.DisplayStringAt(65, 115, (uint8_t *)":", LEFT_MODE);
           lcd.DisplayStringAt(80, 164, (uint8_t *)minute, LEFT_MODE);
-          sprintf(seconde,"%02d",time.tm_sec);
+          sprintf((char*)seconde,"%02d",time.tm_sec);
           lcd.DisplayStringAt(115, 164, (uint8_t *)"/", LEFT_MODE);
           lcd.DisplayStringAt(130, 164, (uint8_t *)seconde, LEFT_MODE);         
-
+ 
           lcd.SetBackColor(LCD_COLOR_BLUE); 
-          sprintf(mois,"%02d",time.tm_mon);
+          sprintf((char*)mois,"%02d",time.tm_mon);
         lcd.DisplayStringAt(80, 82, (uint8_t *) mois, LEFT_MODE);
-
           
  //AFFICHAGE DU BOUTON POUR AUGMENTER   
           lcd.SetTextColor(LCD_COLOR_DARKBLUE);
@@ -275,7 +351,7 @@
           lcd.SetBackColor(LCD_COLOR_DARKMAGENTA);
           lcd.SetTextColor(LCD_COLOR_WHITE);
           lcd.DisplayStringAt(245, LINE(9), (uint8_t *)"  + ", LEFT_MODE);
-
+ 
 //AFFICHAGE DU BOUTON OK            
           lcd.SetTextColor(LCD_COLOR_DARKGREEN);
           lcd.FillRect(360, 210, 80,30);
@@ -283,46 +359,38 @@
           lcd.SetTextColor(LCD_COLOR_WHITE);
           lcd.DisplayStringAt(360, LINE(9), (uint8_t *)" OK ", LEFT_MODE); 
             
+            
            
           }
 
  void Ecran2_Year()
           {
-              struct tm time;
-              time.tm_sec=0;
-           time.tm_min=28;
-           time.tm_hour=14;
-           time.tm_mday=10;
-           time.tm_year=116;
-           time.tm_mon=0;
-           time.tm_wday=2;
-           time.tm_yday=0;
-           time.tm_isdst=0;
-          lcd.Clear(LCD_COLOR_WHITE);
+               struct tm time;
+               lcd.Clear(LCD_COLOR_WHITE);
           lcd.SetTextColor(LCD_COLOR_BLACK);
           lcd.SetBackColor(LCD_COLOR_WHITE); 
           lcd.DisplayStringAt(30, LINE(2), (uint8_t *)"DATE:", LEFT_MODE);
-          sprintf(jour,"%02d",time.tm_mday);
+          sprintf((char*)jour,"%02d",time.tm_mday);
           lcd.DisplayStringAt(30, 82, (uint8_t *)jour, LEFT_MODE);
           lcd.DisplayStringAt(65, 82, (uint8_t *)"/", LEFT_MODE);
-          sprintf(mois,"%02d",time.tm_mon);
+          sprintf((char*)mois,"%02d",time.tm_mon);
           lcd.DisplayStringAt(80, 82, (uint8_t *) mois, LEFT_MODE);
           lcd.DisplayStringAt(115, 82, (uint8_t *)"/", LEFT_MODE);
           lcd.DisplayStringAt(30, 135, (uint8_t *)"TIME:", LEFT_MODE);
-          sprintf(heure,"%02d",time.tm_hour);
+          sprintf((char*)heure,"%02d",time.tm_hour);
           lcd.DisplayStringAt(30, 164, (uint8_t *)heure, LEFT_MODE);
           lcd.DisplayStringAt(65, 164, (uint8_t *)":", LEFT_MODE);
-          sprintf(minute,"%02d",time.tm_min);
+          sprintf((char*)minute,"%02d",time.tm_min);
           lcd.DisplayStringAt(80, 164, (uint8_t *)minute, LEFT_MODE);
           lcd.DisplayStringAt(115, 164, (uint8_t *)"/", LEFT_MODE);
-          sprintf(seconde,"%02d",time.tm_sec);
+          sprintf((char*)seconde,"%02d",time.tm_sec);
           lcd.DisplayStringAt(130, 164, (uint8_t *)seconde, LEFT_MODE);
                  
           lcd.SetBackColor(LCD_COLOR_BLUE); 
-          sprintf(annee,"%04d",time.tm_year);
+          sprintf((char*)annee,"%04d",time.tm_year);
           lcd.DisplayStringAt(130, 82, (uint8_t *)annee, LEFT_MODE);
-          
-
+     
+ 
           
  //AFFICHAGE DU BOUTON POUR AUGMENTER   
           lcd.SetTextColor(LCD_COLOR_DARKBLUE);
@@ -338,7 +406,7 @@
           lcd.SetBackColor(LCD_COLOR_DARKMAGENTA);
           lcd.SetTextColor(LCD_COLOR_WHITE);
           lcd.DisplayStringAt(245, LINE(9), (uint8_t *)"  + ", LEFT_MODE);
-
+ 
 //AFFICHAGE DU BOUTON OK            
           lcd.SetTextColor(LCD_COLOR_DARKGREEN);
           lcd.FillRect(360, 210, 80,30);
@@ -346,46 +414,38 @@
           lcd.SetTextColor(LCD_COLOR_WHITE);
           lcd.DisplayStringAt(360, LINE(9), (uint8_t *)" OK ", LEFT_MODE); 
      
+     
            
           }         
 
  void Ecran2_Hour()
           { 
-           struct tm time;
-           time.tm_sec=0;
-           time.tm_min=28;
-           time.tm_hour=14;
-           time.tm_mday=10;
-           time.tm_year=116;
-           time.tm_mon=0;
-           time.tm_wday=2;
-           time.tm_yday=0;
-           time.tm_isdst=0;
-          lcd.Clear(LCD_COLOR_WHITE);
+              struct tm time;
+             lcd.Clear(LCD_COLOR_WHITE);
           lcd.SetTextColor(LCD_COLOR_BLACK);
           lcd.SetBackColor(LCD_COLOR_WHITE); 
           lcd.DisplayStringAt(30, LINE(2), (uint8_t *)"DATE:", LEFT_MODE);
-          sprintf(jour,"%02d",time.tm_mday);
+          sprintf((char*)jour,"%02d",time.tm_mday);
           lcd.DisplayStringAt(30, 82, (uint8_t *)jour, LEFT_MODE);
           lcd.DisplayStringAt(65, 82, (uint8_t *)"/", LEFT_MODE);
-          sprintf(mois,"%02d",time.tm_mon);
+          sprintf((char*)mois,"%02d",time.tm_mon);
           lcd.DisplayStringAt(80, 82, (uint8_t *) mois, LEFT_MODE);
           lcd.DisplayStringAt(115, 82, (uint8_t *)"/", LEFT_MODE);
-          sprintf(annee,"%04d",time.tm_year);
+          sprintf((char*)annee,"%04d",time.tm_year);
           lcd.DisplayStringAt(130, 82, (uint8_t *)annee, LEFT_MODE);
           lcd.DisplayStringAt(30, 135, (uint8_t *)"TIME:", LEFT_MODE);
           lcd.DisplayStringAt(65, 164, (uint8_t *)":", LEFT_MODE);
-          sprintf(minute,"%02d",time.tm_min);
+          sprintf((char*)minute,"%02d",time.tm_min);
           lcd.DisplayStringAt(80, 164, (uint8_t *)minute, LEFT_MODE);
           lcd.DisplayStringAt(115, 164, (uint8_t *)":", LEFT_MODE);
-          sprintf(seconde,"%02d",time.tm_sec);
+          sprintf((char*)seconde,"%02d",time.tm_sec);
           lcd.DisplayStringAt(130, 164, (uint8_t *)seconde, LEFT_MODE);
     
           lcd.SetBackColor(LCD_COLOR_BLUE); 
-          sprintf(heure,"%02d",time.tm_hour);
+          sprintf((char*)heure,"%02d",time.tm_hour);
           lcd.DisplayStringAt(30, 164, (uint8_t *)heure, LEFT_MODE);
           
-
+ 
           
  //AFFICHAGE DU BOUTON POUR AUGMENTER   
           lcd.SetTextColor(LCD_COLOR_DARKBLUE);
@@ -401,7 +461,7 @@
           lcd.SetBackColor(LCD_COLOR_DARKMAGENTA);
           lcd.SetTextColor(LCD_COLOR_WHITE);
           lcd.DisplayStringAt(245, LINE(9), (uint8_t *)"  + ", LEFT_MODE);
-
+ 
 //AFFICHAGE DU BOUTON OK            
           lcd.SetTextColor(LCD_COLOR_DARKGREEN);
           lcd.FillRect(360, 210, 80,30);
@@ -410,20 +470,12 @@
           lcd.DisplayStringAt(360, LINE(9), (uint8_t *)" OK ", LEFT_MODE); 
            
            
+           
           }  
 
  void Ecran2_Minutes()
           {
-           struct tm time;
-           time.tm_sec=0;
-           time.tm_min=28;
-           time.tm_hour=14;
-           time.tm_mday=10;
-           time.tm_year=116;
-           time.tm_mon=0;
-           time.tm_wday=2;
-           time.tm_yday=0;
-           time.tm_isdst=0;
+             struct tm time;
            lcd.Clear(LCD_COLOR_WHITE);
           lcd.SetTextColor(LCD_COLOR_BLACK);
           lcd.SetBackColor(LCD_COLOR_WHITE); 
@@ -447,8 +499,8 @@
           lcd.SetBackColor(LCD_COLOR_BLUE); 
           sprintf(minute,"%02d",time.tm_min);
           lcd.DisplayStringAt(80, 164, (uint8_t *)minute, LEFT_MODE);
-         
-
+        
+ 
           
 //AFFICHAGE DU BOUTON POUR AUGMENTER   
           lcd.SetTextColor(LCD_COLOR_DARKBLUE);
@@ -464,21 +516,20 @@
           lcd.SetBackColor(LCD_COLOR_DARKMAGENTA);
           lcd.SetTextColor(LCD_COLOR_WHITE);
           lcd.DisplayStringAt(245, LINE(9), (uint8_t *)"  + ", LEFT_MODE);
-
+ 
 //AFFICHAGE DU BOUTON OK            
           lcd.SetTextColor(LCD_COLOR_DARKGREEN);
           lcd.FillRect(360, 210, 80,30);
           lcd.SetBackColor(LCD_COLOR_DARKGREEN);
           lcd.SetTextColor(LCD_COLOR_WHITE);
           lcd.DisplayStringAt(360, LINE(9), (uint8_t *)" OK ", LEFT_MODE); 
-           
-           
           }     
          
  void Ecran2_Seconde()
           {
-            struct tm time;
-            lcd.Clear(LCD_COLOR_WHITE);
+            
+                struct tm time;
+               lcd.Clear(LCD_COLOR_WHITE);
           lcd.SetTextColor(LCD_COLOR_BLACK);
           lcd.SetBackColor(LCD_COLOR_WHITE); 
           lcd.DisplayStringAt(30, LINE(2), (uint8_t *)"TIME:", LEFT_MODE);
@@ -502,7 +553,7 @@
            sprintf(seconde,"%02d ",time.tm_sec);
           lcd.DisplayStringAt(130, 164, (uint8_t *)seconde, LEFT_MODE);
               
-
+ 
           
 //AFFICHAGE DU BOUTON POUR AUGMENTER   
           lcd.SetTextColor(LCD_COLOR_DARKBLUE);
@@ -518,13 +569,13 @@
           lcd.SetBackColor(LCD_COLOR_DARKMAGENTA);
           lcd.SetTextColor(LCD_COLOR_WHITE);
           lcd.DisplayStringAt(245, LINE(9), (uint8_t *)"  + ", LEFT_MODE);
-
+ 
 //AFFICHAGE DU BOUTON OK            
           lcd.SetTextColor(LCD_COLOR_DARKGREEN);
           lcd.FillRect(360, 210, 80,30);
           lcd.SetBackColor(LCD_COLOR_DARKGREEN);
           lcd.SetTextColor(LCD_COLOR_WHITE);
-          lcd.DisplayStringAt(360, LINE(9), (uint8_t *)" OK ", LEFT_MODE); 
+          lcd.DisplayStringAt(360, LINE(9), (uint8_t *)" OK ", LEFT_MODE);  
            }         
            
           
@@ -538,8 +589,9 @@
           lcd.DisplayStringAt(10, LINE(1), (uint8_t *)"Select the frequency of", CENTER_MODE);
           lcd.DisplayStringAt(10, LINE(2), (uint8_t *)"sending of the data on the", CENTER_MODE);
           lcd.DisplayStringAt(10, LINE(3), (uint8_t *)"SD card: ", CENTER_MODE);
-          
-          lcd.DisplayStringAt(30,120, (uint8_t *)"Per hour ", LEFT_MODE);
+          lcd.SetBackColor(LCD_COLOR_GREEN);
+          lcd.DisplayStringAt(30,120, (uint8_t *)"Acquire ", LEFT_MODE);
+          lcd.SetBackColor(LCD_COLOR_WHITE);
           lcd.DisplayStringAt(250, 120, (uint8_t *)"Per day", LEFT_MODE);
           lcd.DisplayStringAt(30, 160, (uint8_t *)"Per week ", LEFT_MODE);
           lcd.DisplayStringAt(250, 160, (uint8_t *)"Per month", LEFT_MODE);
@@ -556,6 +608,11 @@
           lcd.SetBackColor(LCD_COLOR_DARKRED);
           lcd.SetTextColor(LCD_COLOR_WHITE); 
           lcd.DisplayStringAt(30, LINE(9), (uint8_t *)"BACK", LEFT_MODE); 
+          
+           //AFFICHAGE DU BOUTON POUR VISUALISER la date
+            lcd.SetBackColor(LCD_COLOR_BLACK);
+            lcd.SetTextColor(LCD_COLOR_WHITE);
+            lcd.DisplayStringAt(400,0 , (uint8_t *)"TIME", LEFT_MODE);
            }
            
            void Ecran3_PerHour()
@@ -575,38 +632,39 @@
              
            }
            
-           
-///////FONCTION QUI AFFICHE LE NOUVEL ECRAN APRES L'APPUIE DE SUR AFFICHAGE
-           
-            void Ecran4()
-          {
+////FONCTION QUI AFFICHE LE MOT DE PASSE///////
+void MotDePasse()
+{ 
+   lcd.Clear(LCD_COLOR_WHITE);
+   lcd.SetBackColor(LCD_COLOR_WHITE);
+   lcd.SetTextColor(LCD_COLOR_BLACK);
+   lcd.DisplayStringAt(0, LINE(1), (uint8_t *)" PASSWORD: ",LEFT_MODE);
 
-  //AFFICHAGE DU BOUTON QUITTER                  
-          lcd.SetTextColor(LCD_COLOR_RED);
-          lcd.FillRect(30, 210, 80,30);
-          lcd.SetBackColor(LCD_COLOR_RED);
-          lcd.SetTextColor(LCD_COLOR_WHITE); 
-          lcd.DisplayStringAt(30, LINE(9), (uint8_t *)"QUIT", LEFT_MODE);
-    
+         lcd.SetTextColor(LCD_COLOR_BLACK);
+         lcd.FillRect(120, 80, 240, 160);
+         
+          lcd.SetBackColor(LCD_COLOR_DARKGRAY);
+          lcd.SetTextColor(LCD_COLOR_WHITE);
+          lcd.DisplayStringAt(135,90, (uint8_t *)" 1 ", LEFT_MODE);
+          lcd.DisplayStringAt(215, 90, (uint8_t *)" 2 ", LEFT_MODE); 
+          lcd.DisplayStringAt(295, 90, (uint8_t *)" 3 ", LEFT_MODE);   
+          lcd.DisplayStringAt(135,130, (uint8_t *)" 4 ", LEFT_MODE);
+          lcd.DisplayStringAt(215, 130, (uint8_t *)" 5 ", LEFT_MODE);
+          lcd.DisplayStringAt(295, 130, (uint8_t *)" 6 ", LEFT_MODE);
+          lcd.DisplayStringAt(135, 170, (uint8_t *)" 7 ", LEFT_MODE);
+          lcd.DisplayStringAt(215, 170, (uint8_t *)" 8 ", LEFT_MODE);
+          lcd.DisplayStringAt(295, 170, (uint8_t *)" 9 ", LEFT_MODE);
           
- //AFFICHAGE DU BOUTON RETOUR   
-          lcd.SetTextColor(LCD_COLOR_CYAN);
-          lcd.FillRect(145, 210, 80,30);
-          lcd.SetBackColor(LCD_COLOR_CYAN);
+          lcd.SetBackColor(LCD_COLOR_GREEN);
           lcd.SetTextColor(LCD_COLOR_WHITE);
-          lcd.DisplayStringAt(145, LINE(9), (uint8_t *)"BACK", LEFT_MODE);
-          
- //AFFICHAGE DU BOUTON SUIVANT
-          lcd.SetTextColor(LCD_COLOR_CYAN);
-          lcd.FillRect(245, 210, 80,30);
-          lcd.SetBackColor(LCD_COLOR_CYAN);
-          lcd.SetTextColor(LCD_COLOR_WHITE);
-          lcd.DisplayStringAt(245, LINE(9), (uint8_t *)"NEXT", LEFT_MODE);
-          
-//AFFICHAGE DU BOUTON OK            
-          lcd.SetTextColor(LCD_COLOR_GREEN);
-          lcd.FillRect(360, 210, 80,30);
-           lcd.SetBackColor(LCD_COLOR_GREEN);
-          lcd.SetTextColor(LCD_COLOR_WHITE);
-         lcd.DisplayStringAt(360, LINE(9), (uint8_t *)" OK ", LEFT_MODE);
-         } 
+          lcd.DisplayStringAt(210, 210, (uint8_t *)" OK ", LEFT_MODE);
+                
+ //AFFICHAGE DU BOUTON RETOUR        
+          lcd.SetTextColor(LCD_COLOR_DARKRED);
+          lcd.FillRect(30, 210, 80,30);
+          lcd.SetBackColor(LCD_COLOR_DARKRED);
+          lcd.SetTextColor(LCD_COLOR_WHITE); 
+          lcd.DisplayStringAt(30, LINE(9), (uint8_t *)"BACK", LEFT_MODE);
+ }
+ ///////////////////////////////////////////////////////////////////
+ 
\ No newline at end of file