rtc

Dependents:   programme_final

Files at this revision

API Documentation at this revision

Comitter:
Asoumy
Date:
Wed Nov 23 23:01:05 2016 +0000
Parent:
2:7ace46b4f4f3
Commit message:
dd

Changed in this revision

Ecran.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/Ecran.cpp	Sun Oct 23 17:43:04 2016 +0000
+++ b/Ecran.cpp	Wed Nov 23 23:01:05 2016 +0000
@@ -188,8 +188,7 @@
          {
            DS1338 ds1338(D14,D15);
            struct tm time;
-           
-           
+            
         lcd.Clear(LCD_COLOR_WHITE);
           lcd.SetTextColor(LCD_COLOR_BLACK);
           lcd.SetBackColor(LCD_COLOR_WHITE); 
@@ -214,29 +213,27 @@
           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);
-         
+          lcd.DisplayStringAt(30,LINE(9), (uint8_t *)"BACK", LEFT_MODE);      
   }
   
   void reg_time(){
-       struct tm time;
-       int i=0;
+       struct tm time;//appelle de la structure avec les paramétres
+       int i=0; // initialisation de variables
       while (true) {
         
         DS1338 ds1338(D14,D15);
         lcd.SetTextColor(LCD_COLOR_WHITE);
-        sprintf((char*)date, "%s", asctime(&time));
+        sprintf((char*)date, "%s", asctime(&time)); //affichage de toute la structure de l'heure 
         lcd.DisplayStringAt(0, LINE(1), (uint8_t *)date, LEFT_MODE);
         
        // sprintf((char*)date, "Touches: %s",time.tm_mday);
         wait(0.5);
-        ds1338.readTime(&time);
+        ds1338.readTime(&time);// lecture de l'horloge
         
         lcd.Clear(LCD_COLOR_WHITE);
           lcd.SetTextColor(LCD_COLOR_BLACK);
@@ -249,7 +246,7 @@
           lcd.SetBackColor(LCD_COLOR_DARKRED);
           lcd.SetTextColor(LCD_COLOR_WHITE); 
           lcd.DisplayStringAt(30,LINE(9), (uint8_t *)"BACK", LEFT_MODE);
-          if(i++==10)
+          if(i++==10)// sortie de la boucle while sur 10 ittérrationbs
           break;
           
    }        }