rtc

Dependents:   programme_final

Committer:
Asoumy
Date:
Sun Oct 23 17:43:04 2016 +0000
Revision:
2:7ace46b4f4f3
Parent:
1:2babe1d342dc
Child:
3:195aa91ec748
toott

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Asoumy 1:2babe1d342dc 1
Asoumy 1:2babe1d342dc 2 #include "mbed.h"
Asoumy 1:2babe1d342dc 3 #include "Ecran.h"
Asoumy 1:2babe1d342dc 4 #include "LCD_DISCO_F746NG.h"
Asoumy 1:2babe1d342dc 5 #include "TS_DISCO_F746NG.h"
Asoumy 1:2babe1d342dc 6 #include "ds1338.h"
Asoumy 1:2babe1d342dc 7
Asoumy 1:2babe1d342dc 8 LCD_DISCO_F746NG lcd;
Asoumy 1:2babe1d342dc 9
Asoumy 1:2babe1d342dc 10
Asoumy 1:2babe1d342dc 11 ///////////////////////////// AFFICHAGE_DES_ECRANS////////////////////////////////////////////
Asoumy 2:7ace46b4f4f3 12 AnalogIn Vpan(A0);
Asoumy 2:7ace46b4f4f3 13 AnalogIn Ipan(A1);
Asoumy 2:7ace46b4f4f3 14 AnalogIn Tpan(A2);
Asoumy 2:7ace46b4f4f3 15 AnalogIn Irr(A3);
Asoumy 2:7ace46b4f4f3 16 AnalogIn Vbat(A4);
Asoumy 2:7ace46b4f4f3 17 AnalogIn Ibat(A5);
Asoumy 1:2babe1d342dc 18
Asoumy 1:2babe1d342dc 19 void horloge();
Asoumy 1:2babe1d342dc 20 char jour[6];
Asoumy 1:2babe1d342dc 21 char mois[6];
Asoumy 1:2babe1d342dc 22 char annee[6];
Asoumy 1:2babe1d342dc 23 char heure[6];
Asoumy 1:2babe1d342dc 24 char minute[6];
Asoumy 1:2babe1d342dc 25 char seconde[6];
Asoumy 2:7ace46b4f4f3 26 char date [60];
Asoumy 2:7ace46b4f4f3 27 char Vpan1 [3];
Asoumy 2:7ace46b4f4f3 28 unsigned int day =00;
Asoumy 2:7ace46b4f4f3 29 unsigned int month =00;
Asoumy 2:7ace46b4f4f3 30 unsigned int year=2000;
Asoumy 2:7ace46b4f4f3 31 unsigned int hour =00;
Asoumy 2:7ace46b4f4f3 32 unsigned int min =00;
Asoumy 2:7ace46b4f4f3 33 unsigned int sec=00;
Asoumy 2:7ace46b4f4f3 34
Asoumy 1:2babe1d342dc 35
Asoumy 1:2babe1d342dc 36 //////////////////premier ecran///////////////////////
Asoumy 1:2babe1d342dc 37 void principal()
Asoumy 1:2babe1d342dc 38 {
Asoumy 1:2babe1d342dc 39 LCD_DISCO_F746NG lcd;
Asoumy 1:2babe1d342dc 40 lcd.Clear(LCD_COLOR_BLACK);
Asoumy 1:2babe1d342dc 41 lcd.SetBackColor(LCD_COLOR_BLACK);
Asoumy 1:2babe1d342dc 42 lcd.SetTextColor(LCD_COLOR_WHITE);
Asoumy 1:2babe1d342dc 43 lcd.DisplayStringAt(0, LINE(5), (uint8_t *)"WELCOME TO LAOS PROJET", CENTER_MODE);
Asoumy 1:2babe1d342dc 44 }
Asoumy 1:2babe1d342dc 45 ///////FONTCTION QUI AFFICHE LE MODE UTILISATEUR ET LE MODE ADMINISTRATEUR///
Asoumy 1:2babe1d342dc 46 void Ecranprincipal()
Asoumy 1:2babe1d342dc 47 {
Asoumy 1:2babe1d342dc 48 lcd.Clear(LCD_COLOR_WHITE);
Asoumy 1:2babe1d342dc 49 lcd.SetBackColor(LCD_COLOR_WHITE);
Asoumy 1:2babe1d342dc 50 lcd.SetTextColor(LCD_COLOR_WHITE);
Asoumy 1:2babe1d342dc 51 lcd.FillRect(0,0,239,272);
Asoumy 1:2babe1d342dc 52 lcd.SetTextColor(LCD_COLOR_BLACK);
Asoumy 1:2babe1d342dc 53 lcd.DisplayStringAt(0, LINE(5), (uint8_t *)"ADMINISTRATOR", LEFT_MODE);
Asoumy 1:2babe1d342dc 54
Asoumy 1:2babe1d342dc 55
Asoumy 1:2babe1d342dc 56 lcd.SetBackColor(LCD_COLOR_BLACK);
Asoumy 1:2babe1d342dc 57 lcd.SetTextColor(LCD_COLOR_BLACK);
Asoumy 1:2babe1d342dc 58 lcd.FillRect(240,0,240,272);
Asoumy 1:2babe1d342dc 59 lcd.SetTextColor(LCD_COLOR_WHITE);
Asoumy 1:2babe1d342dc 60 lcd.DisplayStringAt(0, LINE(5), (uint8_t *)"USER ACCOUNT", RIGHT_MODE);
Asoumy 1:2babe1d342dc 61 }
Asoumy 1:2babe1d342dc 62
Asoumy 1:2babe1d342dc 63
Asoumy 1:2babe1d342dc 64 ////FONTCTION QUI AFFICHE LE MENU PRINCIPAL///////
Asoumy 1:2babe1d342dc 65
Asoumy 1:2babe1d342dc 66 void EcranAdminis()
Asoumy 1:2babe1d342dc 67 {
Asoumy 1:2babe1d342dc 68 lcd.Clear(LCD_COLOR_WHITE);
Asoumy 1:2babe1d342dc 69
Asoumy 1:2babe1d342dc 70
Asoumy 1:2babe1d342dc 71 //AFFICHAGE DU BOUTON POUR REGLER L'HEURE ET LA DATE
Asoumy 1:2babe1d342dc 72
Asoumy 1:2babe1d342dc 73 lcd.SetTextColor(LCD_COLOR_BLACK);
Asoumy 1:2babe1d342dc 74 lcd.DrawRect(10,50,155,130);
Asoumy 1:2babe1d342dc 75 lcd.SetBackColor(LCD_COLOR_WHITE);
Asoumy 1:2babe1d342dc 76 lcd.SetTextColor(LCD_COLOR_DARKCYAN);
Asoumy 1:2babe1d342dc 77 lcd.DisplayStringAt(13, LINE(3), (uint8_t *)"Adjust", LEFT_MODE);
Asoumy 1:2babe1d342dc 78 lcd.DisplayStringAt(13, LINE(4), (uint8_t *)"the date", LEFT_MODE);
Asoumy 1:2babe1d342dc 79 lcd.DisplayStringAt(13, LINE(5), (uint8_t *)"and time", LEFT_MODE);
Asoumy 1:2babe1d342dc 80
Asoumy 1:2babe1d342dc 81
Asoumy 1:2babe1d342dc 82 //AFFICHAGE DU BOUTON POUR REGLER LA FREQUENCE D'ENVOI SUR LA CARTE SD
Asoumy 1:2babe1d342dc 83 lcd.SetTextColor(LCD_COLOR_BLACK);
Asoumy 1:2babe1d342dc 84 lcd.DrawRect(170,50,158,130);
Asoumy 1:2babe1d342dc 85 lcd.SetBackColor(LCD_COLOR_WHITE);
Asoumy 1:2babe1d342dc 86 lcd.SetTextColor(LCD_COLOR_DARKRED);
Asoumy 1:2babe1d342dc 87 lcd.DisplayStringAt(173, LINE(3), (uint8_t *)"Adjust ", LEFT_MODE);
Asoumy 1:2babe1d342dc 88 lcd.DisplayStringAt(173, LINE(4), (uint8_t *)"the ", LEFT_MODE);
Asoumy 1:2babe1d342dc 89 lcd.DisplayStringAt(173, LINE(5), (uint8_t *)"Delivery", LEFT_MODE);
Asoumy 1:2babe1d342dc 90 lcd.DisplayStringAt(173, LINE(6), (uint8_t *)"frequency", LEFT_MODE);
Asoumy 1:2babe1d342dc 91
Asoumy 1:2babe1d342dc 92 //AFFICHAGE DU BOUTON POUR AFFICHAGER LES DONNEES ARRIVEES SUR LA CARTE
Asoumy 1:2babe1d342dc 93 lcd.SetTextColor(LCD_COLOR_BLACK);
Asoumy 1:2babe1d342dc 94 lcd.DrawRect(332, 50, 145,130);
Asoumy 1:2babe1d342dc 95 lcd.SetBackColor(LCD_COLOR_WHITE);
Asoumy 1:2babe1d342dc 96 lcd.SetTextColor(LCD_COLOR_DARKGREEN);
Asoumy 1:2babe1d342dc 97 lcd.DisplayStringAt(333, LINE(3), (uint8_t *)"The ", LEFT_MODE);
Asoumy 1:2babe1d342dc 98 lcd.DisplayStringAt(333, LINE(4), (uint8_t *)"data", LEFT_MODE);
Asoumy 1:2babe1d342dc 99 lcd.DisplayStringAt(333, LINE(5), (uint8_t *)"display", LEFT_MODE);
Asoumy 1:2babe1d342dc 100
Asoumy 1:2babe1d342dc 101 //AFFICHAGE DU BOUTON RETOUR
Asoumy 1:2babe1d342dc 102 lcd.SetTextColor(LCD_COLOR_DARKRED);
Asoumy 1:2babe1d342dc 103 lcd.FillRect(30, 210, 80,30);
Asoumy 1:2babe1d342dc 104 lcd.SetBackColor(LCD_COLOR_DARKRED);
Asoumy 1:2babe1d342dc 105 lcd.SetTextColor(LCD_COLOR_WHITE);
Asoumy 1:2babe1d342dc 106 lcd.DisplayStringAt(30, LINE(9), (uint8_t *)"BACK", LEFT_MODE);
Asoumy 2:7ace46b4f4f3 107 //AFFICHAGE DU BOUTON POUR VISUALISER la date
Asoumy 2:7ace46b4f4f3 108 lcd.SetBackColor(LCD_COLOR_BLACK);
Asoumy 2:7ace46b4f4f3 109 lcd.SetTextColor(LCD_COLOR_WHITE);
Asoumy 2:7ace46b4f4f3 110 lcd.DisplayStringAt(400,0 , (uint8_t *)"TIME", LEFT_MODE);
Asoumy 1:2babe1d342dc 111 }
Asoumy 1:2babe1d342dc 112
Asoumy 2:7ace46b4f4f3 113 void EcranUtilis_ok()
Asoumy 2:7ace46b4f4f3 114 {
Asoumy 2:7ace46b4f4f3 115 lcd.Clear(LCD_COLOR_DARKGRAY);
Asoumy 2:7ace46b4f4f3 116 lcd.SetBackColor(LCD_COLOR_DARKGRAY);
Asoumy 2:7ace46b4f4f3 117 lcd.SetTextColor(LCD_COLOR_YELLOW);
Asoumy 2:7ace46b4f4f3 118 lcd.DisplayStringAt(0, LINE(1), (uint8_t *)"THE DATA DISPLAY", CENTER_MODE);
Asoumy 2:7ace46b4f4f3 119
Asoumy 2:7ace46b4f4f3 120 //AFFICHAGE DU BOUTON POUR AFFICHAGER LES DONNEES ARRIVEES SUR LA CARTE
Asoumy 2:7ace46b4f4f3 121 lcd.SetTextColor(LCD_COLOR_GREEN);
Asoumy 2:7ace46b4f4f3 122 lcd.FillRect(25, 75, 180, 30);
Asoumy 2:7ace46b4f4f3 123 lcd.FillRect(245, 75, 180,30);
Asoumy 2:7ace46b4f4f3 124 lcd.FillRect(25, 115, 180, 30);
Asoumy 2:7ace46b4f4f3 125 lcd.FillRect(245, 115, 180,30);
Asoumy 2:7ace46b4f4f3 126 lcd.FillRect(25, 155, 180, 30);
Asoumy 2:7ace46b4f4f3 127 lcd.FillRect(245, 155, 180,30);
Asoumy 2:7ace46b4f4f3 128 lcd.SetBackColor(LCD_COLOR_GREEN);
Asoumy 2:7ace46b4f4f3 129 lcd.SetTextColor(LCD_COLOR_WHITE);
Asoumy 2:7ace46b4f4f3 130 lcd.DisplayStringAt(30,80, (uint8_t *)" Ipanneau", LEFT_MODE);
Asoumy 2:7ace46b4f4f3 131 lcd.DisplayStringAt(250, 80, (uint8_t *)"Vpanneau", LEFT_MODE);
Asoumy 2:7ace46b4f4f3 132 lcd.DisplayStringAt(30,120, (uint8_t *)" Tpanneau", LEFT_MODE);
Asoumy 2:7ace46b4f4f3 133 lcd.DisplayStringAt(250, 120, (uint8_t *)"Iradiation", LEFT_MODE);
Asoumy 2:7ace46b4f4f3 134 lcd.DisplayStringAt(30, 160, (uint8_t *)"Vbatterie ", LEFT_MODE);
Asoumy 2:7ace46b4f4f3 135 lcd.DisplayStringAt(250, 160, (uint8_t *)"Ibatterie", LEFT_MODE);
Asoumy 2:7ace46b4f4f3 136
Asoumy 2:7ace46b4f4f3 137 //AFFICHAGE DU BOUTON RETOUR
Asoumy 2:7ace46b4f4f3 138 lcd.SetTextColor(LCD_COLOR_DARKRED);
Asoumy 2:7ace46b4f4f3 139 lcd.FillRect(30, 210, 80,30);
Asoumy 2:7ace46b4f4f3 140 lcd.SetBackColor(LCD_COLOR_DARKRED);
Asoumy 2:7ace46b4f4f3 141 lcd.SetTextColor(LCD_COLOR_WHITE);
Asoumy 2:7ace46b4f4f3 142 lcd.DisplayStringAt(30, LINE(9), (uint8_t *)"BACK", LEFT_MODE);
Asoumy 2:7ace46b4f4f3 143 //AFFICHAGE DU BOUTON POUR VISUALISER la date
Asoumy 2:7ace46b4f4f3 144 lcd.SetBackColor(LCD_COLOR_BLACK);
Asoumy 2:7ace46b4f4f3 145 lcd.SetTextColor(LCD_COLOR_WHITE);
Asoumy 2:7ace46b4f4f3 146 lcd.DisplayStringAt(400,0 , (uint8_t *)"TIME", LEFT_MODE);
Asoumy 2:7ace46b4f4f3 147 }
Asoumy 2:7ace46b4f4f3 148
Asoumy 2:7ace46b4f4f3 149 void EcranUtilis_fail()
Asoumy 1:2babe1d342dc 150 {
Asoumy 1:2babe1d342dc 151 lcd.Clear(LCD_COLOR_DARKGRAY);
Asoumy 1:2babe1d342dc 152 lcd.SetBackColor(LCD_COLOR_DARKGRAY);
Asoumy 1:2babe1d342dc 153 lcd.SetTextColor(LCD_COLOR_YELLOW);
Asoumy 1:2babe1d342dc 154 lcd.DisplayStringAt(0, LINE(1), (uint8_t *)"THE DATA DISPLAY", CENTER_MODE);
Asoumy 1:2babe1d342dc 155
Asoumy 1:2babe1d342dc 156 //AFFICHAGE DU BOUTON POUR AFFICHAGER LES DONNEES ARRIVEES SUR LA CARTE
Asoumy 2:7ace46b4f4f3 157 lcd.SetTextColor(LCD_COLOR_RED);
Asoumy 2:7ace46b4f4f3 158 lcd.FillRect(25, 75, 180, 30);
Asoumy 2:7ace46b4f4f3 159 lcd.FillRect(245, 75, 180,30);
Asoumy 2:7ace46b4f4f3 160 lcd.FillRect(25, 115, 180, 30);
Asoumy 2:7ace46b4f4f3 161 lcd.FillRect(245, 115, 180,30);
Asoumy 2:7ace46b4f4f3 162 lcd.FillRect(25, 155, 180, 30);
Asoumy 2:7ace46b4f4f3 163 lcd.FillRect(245, 155, 180,30);
Asoumy 2:7ace46b4f4f3 164 lcd.SetBackColor(LCD_COLOR_RED);
Asoumy 2:7ace46b4f4f3 165 lcd.SetTextColor(LCD_COLOR_WHITE);
Asoumy 2:7ace46b4f4f3 166 lcd.DisplayStringAt(30,80, (uint8_t *)" Ipanneau", LEFT_MODE);
Asoumy 2:7ace46b4f4f3 167 lcd.DisplayStringAt(250, 80, (uint8_t *)"Vpanneau", LEFT_MODE);
Asoumy 2:7ace46b4f4f3 168 lcd.DisplayStringAt(30,120, (uint8_t *)" Tpanneau", LEFT_MODE);
Asoumy 2:7ace46b4f4f3 169 lcd.DisplayStringAt(250, 120, (uint8_t *)"Iradiation", LEFT_MODE);
Asoumy 2:7ace46b4f4f3 170 lcd.DisplayStringAt(30, 160, (uint8_t *)"Vbatterie ", LEFT_MODE);
Asoumy 2:7ace46b4f4f3 171 lcd.DisplayStringAt(250, 160, (uint8_t *)"Ibatterie", LEFT_MODE);
Asoumy 2:7ace46b4f4f3 172
Asoumy 1:2babe1d342dc 173 //AFFICHAGE DU BOUTON RETOUR
Asoumy 2:7ace46b4f4f3 174 lcd.SetTextColor(LCD_COLOR_DARKRED);
Asoumy 1:2babe1d342dc 175 lcd.FillRect(30, 210, 80,30);
Asoumy 2:7ace46b4f4f3 176 lcd.SetBackColor(LCD_COLOR_DARKRED);
Asoumy 1:2babe1d342dc 177 lcd.SetTextColor(LCD_COLOR_WHITE);
Asoumy 1:2babe1d342dc 178 lcd.DisplayStringAt(30, LINE(9), (uint8_t *)"BACK", LEFT_MODE);
Asoumy 2:7ace46b4f4f3 179 //AFFICHAGE DU BOUTON POUR VISUALISER la date
Asoumy 2:7ace46b4f4f3 180 lcd.SetBackColor(LCD_COLOR_BLACK);
Asoumy 2:7ace46b4f4f3 181 lcd.SetTextColor(LCD_COLOR_WHITE);
Asoumy 2:7ace46b4f4f3 182 lcd.DisplayStringAt(400,0 , (uint8_t *)"TIME", LEFT_MODE);
Asoumy 1:2babe1d342dc 183 }
Asoumy 1:2babe1d342dc 184 ///////FONCTION QUI AFFICHE LE NOUVEL ECRAN APRES L'APPUIE DE SUR TIME DATE
Asoumy 1:2babe1d342dc 185
Asoumy 1:2babe1d342dc 186
Asoumy 1:2babe1d342dc 187 void Ecran2()
Asoumy 1:2babe1d342dc 188 {
Asoumy 2:7ace46b4f4f3 189 DS1338 ds1338(D14,D15);
Asoumy 1:2babe1d342dc 190 struct tm time;
Asoumy 2:7ace46b4f4f3 191
Asoumy 2:7ace46b4f4f3 192
Asoumy 2:7ace46b4f4f3 193 lcd.Clear(LCD_COLOR_WHITE);
Asoumy 1:2babe1d342dc 194 lcd.SetTextColor(LCD_COLOR_BLACK);
Asoumy 1:2babe1d342dc 195 lcd.SetBackColor(LCD_COLOR_WHITE);
Asoumy 1:2babe1d342dc 196
Asoumy 1:2babe1d342dc 197 lcd.DisplayStringAt(30, LINE(2), (uint8_t *)"DATE:", LEFT_MODE);
Asoumy 2:7ace46b4f4f3 198 sprintf((char*)jour,"%02d",time.tm_mday);
Asoumy 1:2babe1d342dc 199 lcd.DisplayStringAt(30, 82, (uint8_t *)jour, LEFT_MODE);
Asoumy 1:2babe1d342dc 200 lcd.DisplayStringAt(65, 82, (uint8_t *)"/", LEFT_MODE);
Asoumy 2:7ace46b4f4f3 201 sprintf((char*)mois,"%02d",time.tm_mon);
Asoumy 1:2babe1d342dc 202 lcd.DisplayStringAt(80, 82, (uint8_t *) mois, LEFT_MODE);
Asoumy 1:2babe1d342dc 203 lcd.DisplayStringAt(115, 82, (uint8_t *)"/", LEFT_MODE);
Asoumy 2:7ace46b4f4f3 204 sprintf((char*)annee,"%04d",time.tm_year);
Asoumy 1:2babe1d342dc 205 lcd.DisplayStringAt(130, 82, (uint8_t *)annee, LEFT_MODE);
Asoumy 1:2babe1d342dc 206
Asoumy 1:2babe1d342dc 207 lcd.DisplayStringAt(30, 135, (uint8_t *)"TIME:", LEFT_MODE);
Asoumy 2:7ace46b4f4f3 208 sprintf((char*)heure,"%02d",time.tm_hour);
Asoumy 1:2babe1d342dc 209 lcd.DisplayStringAt(30, 164, (uint8_t *)heure, LEFT_MODE);
Asoumy 1:2babe1d342dc 210 lcd.DisplayStringAt(65, 164, (uint8_t *)":", LEFT_MODE);
Asoumy 2:7ace46b4f4f3 211 sprintf((char*)minute,"%02d",time.tm_min);
Asoumy 1:2babe1d342dc 212 lcd.DisplayStringAt(80, 164, (uint8_t *)minute, LEFT_MODE);
Asoumy 1:2babe1d342dc 213 lcd.DisplayStringAt(115, 164, (uint8_t *)":", LEFT_MODE);
Asoumy 2:7ace46b4f4f3 214 sprintf((char*)seconde,"%02d",time.tm_sec);
Asoumy 1:2babe1d342dc 215 lcd.DisplayStringAt(130, 164, (uint8_t *)seconde, LEFT_MODE);
Asoumy 2:7ace46b4f4f3 216
Asoumy 2:7ace46b4f4f3 217
Asoumy 2:7ace46b4f4f3 218 //AFFICHAGE DU BOUTON QUITTER
Asoumy 2:7ace46b4f4f3 219 lcd.SetTextColor(LCD_COLOR_DARKRED);
Asoumy 2:7ace46b4f4f3 220 lcd.FillRect(30, 210, 80,30);
Asoumy 2:7ace46b4f4f3 221 lcd.SetBackColor(LCD_COLOR_DARKRED);
Asoumy 2:7ace46b4f4f3 222 lcd.SetTextColor(LCD_COLOR_WHITE);
Asoumy 2:7ace46b4f4f3 223 lcd.DisplayStringAt(30,LINE(9), (uint8_t *)"BACK", LEFT_MODE);
Asoumy 2:7ace46b4f4f3 224
Asoumy 2:7ace46b4f4f3 225 }
Asoumy 2:7ace46b4f4f3 226
Asoumy 2:7ace46b4f4f3 227 void reg_time(){
Asoumy 2:7ace46b4f4f3 228 struct tm time;
Asoumy 2:7ace46b4f4f3 229 int i=0;
Asoumy 2:7ace46b4f4f3 230 while (true) {
Asoumy 2:7ace46b4f4f3 231
Asoumy 2:7ace46b4f4f3 232 DS1338 ds1338(D14,D15);
Asoumy 2:7ace46b4f4f3 233 lcd.SetTextColor(LCD_COLOR_WHITE);
Asoumy 2:7ace46b4f4f3 234 sprintf((char*)date, "%s", asctime(&time));
Asoumy 2:7ace46b4f4f3 235 lcd.DisplayStringAt(0, LINE(1), (uint8_t *)date, LEFT_MODE);
Asoumy 2:7ace46b4f4f3 236
Asoumy 2:7ace46b4f4f3 237 // sprintf((char*)date, "Touches: %s",time.tm_mday);
Asoumy 2:7ace46b4f4f3 238 wait(0.5);
Asoumy 2:7ace46b4f4f3 239 ds1338.readTime(&time);
Asoumy 2:7ace46b4f4f3 240
Asoumy 2:7ace46b4f4f3 241 lcd.Clear(LCD_COLOR_WHITE);
Asoumy 2:7ace46b4f4f3 242 lcd.SetTextColor(LCD_COLOR_BLACK);
Asoumy 2:7ace46b4f4f3 243 lcd.SetBackColor(LCD_COLOR_WHITE);
Asoumy 2:7ace46b4f4f3 244
Asoumy 1:2babe1d342dc 245
Asoumy 1:2babe1d342dc 246 //AFFICHAGE DU BOUTON QUITTER
Asoumy 1:2babe1d342dc 247 lcd.SetTextColor(LCD_COLOR_DARKRED);
Asoumy 1:2babe1d342dc 248 lcd.FillRect(30, 210, 80,30);
Asoumy 1:2babe1d342dc 249 lcd.SetBackColor(LCD_COLOR_DARKRED);
Asoumy 1:2babe1d342dc 250 lcd.SetTextColor(LCD_COLOR_WHITE);
Asoumy 1:2babe1d342dc 251 lcd.DisplayStringAt(30,LINE(9), (uint8_t *)"BACK", LEFT_MODE);
Asoumy 2:7ace46b4f4f3 252 if(i++==10)
Asoumy 2:7ace46b4f4f3 253 break;
Asoumy 2:7ace46b4f4f3 254
Asoumy 2:7ace46b4f4f3 255 } }
Asoumy 1:2babe1d342dc 256
Asoumy 1:2babe1d342dc 257 void Ecran2_Day()
Asoumy 1:2babe1d342dc 258 {
Asoumy 2:7ace46b4f4f3 259 struct tm time;
Asoumy 2:7ace46b4f4f3 260 lcd.Clear(LCD_COLOR_WHITE);
Asoumy 1:2babe1d342dc 261 lcd.SetBackColor(LCD_COLOR_WHITE);
Asoumy 1:2babe1d342dc 262 lcd.SetTextColor(LCD_COLOR_BLACK);
Asoumy 1:2babe1d342dc 263 lcd.DisplayStringAt(30, LINE(2), (uint8_t *)"DATE:", LEFT_MODE);
Asoumy 1:2babe1d342dc 264 lcd.DisplayStringAt(65, 82, (uint8_t *)"/", LEFT_MODE);
Asoumy 2:7ace46b4f4f3 265 sprintf((char*)mois,"%02d",time.tm_mon);
Asoumy 1:2babe1d342dc 266 lcd.DisplayStringAt(80, 82, (uint8_t *) mois, LEFT_MODE);
Asoumy 1:2babe1d342dc 267 lcd.DisplayStringAt(115, 82, (uint8_t *)"/", LEFT_MODE);
Asoumy 2:7ace46b4f4f3 268 sprintf((char*)annee,"%04d",time.tm_year);
Asoumy 1:2babe1d342dc 269 lcd.DisplayStringAt(130, 82, (uint8_t *)annee, LEFT_MODE);
Asoumy 1:2babe1d342dc 270
Asoumy 1:2babe1d342dc 271 lcd.DisplayStringAt(30, 135, (uint8_t *)"TIME:", LEFT_MODE);
Asoumy 2:7ace46b4f4f3 272 sprintf((char*)heure,"%02d",time.tm_hour);
Asoumy 1:2babe1d342dc 273 lcd.DisplayStringAt(30, 164, (uint8_t *)heure, LEFT_MODE);
Asoumy 1:2babe1d342dc 274 lcd.DisplayStringAt(65, 164, (uint8_t *)":", LEFT_MODE);
Asoumy 2:7ace46b4f4f3 275 sprintf((char*)minute,"%02d",time.tm_min);
Asoumy 1:2babe1d342dc 276 lcd.DisplayStringAt(80, 164, (uint8_t *)minute, LEFT_MODE);
Asoumy 1:2babe1d342dc 277 lcd.DisplayStringAt(115, 164, (uint8_t *)":", LEFT_MODE);
Asoumy 2:7ace46b4f4f3 278 sprintf((char*)seconde,"%02d ",time.tm_sec);
Asoumy 1:2babe1d342dc 279 lcd.DisplayStringAt(130, 164, (uint8_t *)seconde, LEFT_MODE);
Asoumy 1:2babe1d342dc 280
Asoumy 1:2babe1d342dc 281 lcd.SetBackColor(LCD_COLOR_BLUE);
Asoumy 2:7ace46b4f4f3 282 sprintf((char*)jour,"%02d",time.tm_mday);
Asoumy 1:2babe1d342dc 283 lcd.DisplayStringAt(30, 82, (uint8_t *)jour, LEFT_MODE);
Asoumy 2:7ace46b4f4f3 284
Asoumy 2:7ace46b4f4f3 285
Asoumy 1:2babe1d342dc 286
Asoumy 1:2babe1d342dc 287 //AFFICHAGE DU BOUTON POUR AUGMENTER
Asoumy 1:2babe1d342dc 288 lcd.SetTextColor(LCD_COLOR_DARKBLUE);
Asoumy 1:2babe1d342dc 289 lcd.FillRect(145, 210, 80,30);
Asoumy 1:2babe1d342dc 290 lcd.SetBackColor(LCD_COLOR_DARKBLUE);
Asoumy 1:2babe1d342dc 291 lcd.SetTextColor(LCD_COLOR_WHITE);
Asoumy 1:2babe1d342dc 292 lcd.DisplayStringAt(145, LINE(9), (uint8_t *)" - ", LEFT_MODE);
Asoumy 1:2babe1d342dc 293
Asoumy 1:2babe1d342dc 294
Asoumy 1:2babe1d342dc 295 //AFFICHAGE DU BOUTON POUR DIMINUER
Asoumy 1:2babe1d342dc 296 lcd.SetTextColor(LCD_COLOR_DARKMAGENTA);
Asoumy 1:2babe1d342dc 297 lcd.FillRect(245, 210, 80,30);
Asoumy 1:2babe1d342dc 298 lcd.SetBackColor(LCD_COLOR_DARKMAGENTA);
Asoumy 1:2babe1d342dc 299 lcd.SetTextColor(LCD_COLOR_WHITE);
Asoumy 1:2babe1d342dc 300 lcd.DisplayStringAt(245, LINE(9), (uint8_t *)" + ", LEFT_MODE);
Asoumy 2:7ace46b4f4f3 301
Asoumy 1:2babe1d342dc 302 //AFFICHAGE DU BOUTON OK
Asoumy 1:2babe1d342dc 303 lcd.SetTextColor(LCD_COLOR_DARKGREEN);
Asoumy 1:2babe1d342dc 304 lcd.FillRect(360, 210, 80,30);
Asoumy 1:2babe1d342dc 305 lcd.SetBackColor(LCD_COLOR_DARKGREEN);
Asoumy 1:2babe1d342dc 306 lcd.SetTextColor(LCD_COLOR_WHITE);
Asoumy 1:2babe1d342dc 307 lcd.DisplayStringAt(360, LINE(9), (uint8_t *)" OK ", LEFT_MODE);
Asoumy 1:2babe1d342dc 308
Asoumy 2:7ace46b4f4f3 309
Asoumy 1:2babe1d342dc 310 }
Asoumy 1:2babe1d342dc 311
Asoumy 1:2babe1d342dc 312 void Ecran2_Month()
Asoumy 1:2babe1d342dc 313 {
Asoumy 1:2babe1d342dc 314 struct tm time;
Asoumy 2:7ace46b4f4f3 315 lcd.Clear(LCD_COLOR_WHITE);
Asoumy 1:2babe1d342dc 316 lcd.SetTextColor(LCD_COLOR_BLACK);
Asoumy 1:2babe1d342dc 317 lcd.SetBackColor(LCD_COLOR_WHITE);
Asoumy 1:2babe1d342dc 318 lcd.DisplayStringAt(30, LINE(2), (uint8_t *)"DATE:", LEFT_MODE);
Asoumy 2:7ace46b4f4f3 319 sprintf((char*)jour,"%02d",time.tm_mday);
Asoumy 1:2babe1d342dc 320 lcd.DisplayStringAt(30, 82, (uint8_t *)jour, LEFT_MODE);
Asoumy 1:2babe1d342dc 321 lcd.DisplayStringAt(65, 82, (uint8_t *)"/", LEFT_MODE);
Asoumy 1:2babe1d342dc 322 lcd.DisplayStringAt(115, 82, (uint8_t *)"/", LEFT_MODE);
Asoumy 2:7ace46b4f4f3 323 sprintf((char*)annee,"%04d",time.tm_year);
Asoumy 1:2babe1d342dc 324 lcd.DisplayStringAt(130, 82, (uint8_t *)annee, LEFT_MODE);
Asoumy 1:2babe1d342dc 325 lcd.DisplayStringAt(30, 135, (uint8_t *)"TIME:", LEFT_MODE);
Asoumy 2:7ace46b4f4f3 326 sprintf((char*)heure,"%02d",time.tm_hour);
Asoumy 1:2babe1d342dc 327 lcd.DisplayStringAt(30, 164, (uint8_t *)heure, LEFT_MODE);
Asoumy 1:2babe1d342dc 328 lcd.DisplayStringAt(65, 164, (uint8_t *)":", LEFT_MODE);
Asoumy 2:7ace46b4f4f3 329 sprintf((char*)minute,"%02d",time.tm_min);
Asoumy 1:2babe1d342dc 330 lcd.DisplayStringAt(65, 115, (uint8_t *)":", LEFT_MODE);
Asoumy 1:2babe1d342dc 331 lcd.DisplayStringAt(80, 164, (uint8_t *)minute, LEFT_MODE);
Asoumy 2:7ace46b4f4f3 332 sprintf((char*)seconde,"%02d",time.tm_sec);
Asoumy 1:2babe1d342dc 333 lcd.DisplayStringAt(115, 164, (uint8_t *)"/", LEFT_MODE);
Asoumy 1:2babe1d342dc 334 lcd.DisplayStringAt(130, 164, (uint8_t *)seconde, LEFT_MODE);
Asoumy 2:7ace46b4f4f3 335
Asoumy 1:2babe1d342dc 336 lcd.SetBackColor(LCD_COLOR_BLUE);
Asoumy 2:7ace46b4f4f3 337 sprintf((char*)mois,"%02d",time.tm_mon);
Asoumy 1:2babe1d342dc 338 lcd.DisplayStringAt(80, 82, (uint8_t *) mois, LEFT_MODE);
Asoumy 1:2babe1d342dc 339
Asoumy 1:2babe1d342dc 340 //AFFICHAGE DU BOUTON POUR AUGMENTER
Asoumy 1:2babe1d342dc 341 lcd.SetTextColor(LCD_COLOR_DARKBLUE);
Asoumy 1:2babe1d342dc 342 lcd.FillRect(145, 210, 80,30);
Asoumy 1:2babe1d342dc 343 lcd.SetBackColor(LCD_COLOR_DARKBLUE);
Asoumy 1:2babe1d342dc 344 lcd.SetTextColor(LCD_COLOR_WHITE);
Asoumy 1:2babe1d342dc 345 lcd.DisplayStringAt(145, LINE(9), (uint8_t *)" - ", LEFT_MODE);
Asoumy 1:2babe1d342dc 346
Asoumy 1:2babe1d342dc 347
Asoumy 1:2babe1d342dc 348 //AFFICHAGE DU BOUTON POUR DIMINUER
Asoumy 1:2babe1d342dc 349 lcd.SetTextColor(LCD_COLOR_DARKMAGENTA);
Asoumy 1:2babe1d342dc 350 lcd.FillRect(245, 210, 80,30);
Asoumy 1:2babe1d342dc 351 lcd.SetBackColor(LCD_COLOR_DARKMAGENTA);
Asoumy 1:2babe1d342dc 352 lcd.SetTextColor(LCD_COLOR_WHITE);
Asoumy 1:2babe1d342dc 353 lcd.DisplayStringAt(245, LINE(9), (uint8_t *)" + ", LEFT_MODE);
Asoumy 2:7ace46b4f4f3 354
Asoumy 1:2babe1d342dc 355 //AFFICHAGE DU BOUTON OK
Asoumy 1:2babe1d342dc 356 lcd.SetTextColor(LCD_COLOR_DARKGREEN);
Asoumy 1:2babe1d342dc 357 lcd.FillRect(360, 210, 80,30);
Asoumy 1:2babe1d342dc 358 lcd.SetBackColor(LCD_COLOR_DARKGREEN);
Asoumy 1:2babe1d342dc 359 lcd.SetTextColor(LCD_COLOR_WHITE);
Asoumy 1:2babe1d342dc 360 lcd.DisplayStringAt(360, LINE(9), (uint8_t *)" OK ", LEFT_MODE);
Asoumy 1:2babe1d342dc 361
Asoumy 2:7ace46b4f4f3 362
Asoumy 1:2babe1d342dc 363
Asoumy 1:2babe1d342dc 364 }
Asoumy 1:2babe1d342dc 365
Asoumy 1:2babe1d342dc 366 void Ecran2_Year()
Asoumy 1:2babe1d342dc 367 {
Asoumy 2:7ace46b4f4f3 368 struct tm time;
Asoumy 2:7ace46b4f4f3 369 lcd.Clear(LCD_COLOR_WHITE);
Asoumy 1:2babe1d342dc 370 lcd.SetTextColor(LCD_COLOR_BLACK);
Asoumy 1:2babe1d342dc 371 lcd.SetBackColor(LCD_COLOR_WHITE);
Asoumy 1:2babe1d342dc 372 lcd.DisplayStringAt(30, LINE(2), (uint8_t *)"DATE:", LEFT_MODE);
Asoumy 2:7ace46b4f4f3 373 sprintf((char*)jour,"%02d",time.tm_mday);
Asoumy 1:2babe1d342dc 374 lcd.DisplayStringAt(30, 82, (uint8_t *)jour, LEFT_MODE);
Asoumy 1:2babe1d342dc 375 lcd.DisplayStringAt(65, 82, (uint8_t *)"/", LEFT_MODE);
Asoumy 2:7ace46b4f4f3 376 sprintf((char*)mois,"%02d",time.tm_mon);
Asoumy 1:2babe1d342dc 377 lcd.DisplayStringAt(80, 82, (uint8_t *) mois, LEFT_MODE);
Asoumy 1:2babe1d342dc 378 lcd.DisplayStringAt(115, 82, (uint8_t *)"/", LEFT_MODE);
Asoumy 1:2babe1d342dc 379 lcd.DisplayStringAt(30, 135, (uint8_t *)"TIME:", LEFT_MODE);
Asoumy 2:7ace46b4f4f3 380 sprintf((char*)heure,"%02d",time.tm_hour);
Asoumy 1:2babe1d342dc 381 lcd.DisplayStringAt(30, 164, (uint8_t *)heure, LEFT_MODE);
Asoumy 1:2babe1d342dc 382 lcd.DisplayStringAt(65, 164, (uint8_t *)":", LEFT_MODE);
Asoumy 2:7ace46b4f4f3 383 sprintf((char*)minute,"%02d",time.tm_min);
Asoumy 1:2babe1d342dc 384 lcd.DisplayStringAt(80, 164, (uint8_t *)minute, LEFT_MODE);
Asoumy 1:2babe1d342dc 385 lcd.DisplayStringAt(115, 164, (uint8_t *)"/", LEFT_MODE);
Asoumy 2:7ace46b4f4f3 386 sprintf((char*)seconde,"%02d",time.tm_sec);
Asoumy 1:2babe1d342dc 387 lcd.DisplayStringAt(130, 164, (uint8_t *)seconde, LEFT_MODE);
Asoumy 1:2babe1d342dc 388
Asoumy 1:2babe1d342dc 389 lcd.SetBackColor(LCD_COLOR_BLUE);
Asoumy 2:7ace46b4f4f3 390 sprintf((char*)annee,"%04d",time.tm_year);
Asoumy 1:2babe1d342dc 391 lcd.DisplayStringAt(130, 82, (uint8_t *)annee, LEFT_MODE);
Asoumy 2:7ace46b4f4f3 392
Asoumy 2:7ace46b4f4f3 393
Asoumy 1:2babe1d342dc 394
Asoumy 1:2babe1d342dc 395 //AFFICHAGE DU BOUTON POUR AUGMENTER
Asoumy 1:2babe1d342dc 396 lcd.SetTextColor(LCD_COLOR_DARKBLUE);
Asoumy 1:2babe1d342dc 397 lcd.FillRect(145, 210, 80,30);
Asoumy 1:2babe1d342dc 398 lcd.SetBackColor(LCD_COLOR_DARKBLUE);
Asoumy 1:2babe1d342dc 399 lcd.SetTextColor(LCD_COLOR_WHITE);
Asoumy 1:2babe1d342dc 400 lcd.DisplayStringAt(145, LINE(9), (uint8_t *)" - ", LEFT_MODE);
Asoumy 1:2babe1d342dc 401
Asoumy 1:2babe1d342dc 402
Asoumy 1:2babe1d342dc 403 //AFFICHAGE DU BOUTON POUR DIMINUER
Asoumy 1:2babe1d342dc 404 lcd.SetTextColor(LCD_COLOR_DARKMAGENTA);
Asoumy 1:2babe1d342dc 405 lcd.FillRect(245, 210, 80,30);
Asoumy 1:2babe1d342dc 406 lcd.SetBackColor(LCD_COLOR_DARKMAGENTA);
Asoumy 1:2babe1d342dc 407 lcd.SetTextColor(LCD_COLOR_WHITE);
Asoumy 1:2babe1d342dc 408 lcd.DisplayStringAt(245, LINE(9), (uint8_t *)" + ", LEFT_MODE);
Asoumy 2:7ace46b4f4f3 409
Asoumy 1:2babe1d342dc 410 //AFFICHAGE DU BOUTON OK
Asoumy 1:2babe1d342dc 411 lcd.SetTextColor(LCD_COLOR_DARKGREEN);
Asoumy 1:2babe1d342dc 412 lcd.FillRect(360, 210, 80,30);
Asoumy 1:2babe1d342dc 413 lcd.SetBackColor(LCD_COLOR_DARKGREEN);
Asoumy 1:2babe1d342dc 414 lcd.SetTextColor(LCD_COLOR_WHITE);
Asoumy 1:2babe1d342dc 415 lcd.DisplayStringAt(360, LINE(9), (uint8_t *)" OK ", LEFT_MODE);
Asoumy 1:2babe1d342dc 416
Asoumy 2:7ace46b4f4f3 417
Asoumy 1:2babe1d342dc 418
Asoumy 1:2babe1d342dc 419 }
Asoumy 1:2babe1d342dc 420
Asoumy 1:2babe1d342dc 421 void Ecran2_Hour()
Asoumy 1:2babe1d342dc 422 {
Asoumy 2:7ace46b4f4f3 423 struct tm time;
Asoumy 2:7ace46b4f4f3 424 lcd.Clear(LCD_COLOR_WHITE);
Asoumy 1:2babe1d342dc 425 lcd.SetTextColor(LCD_COLOR_BLACK);
Asoumy 1:2babe1d342dc 426 lcd.SetBackColor(LCD_COLOR_WHITE);
Asoumy 1:2babe1d342dc 427 lcd.DisplayStringAt(30, LINE(2), (uint8_t *)"DATE:", LEFT_MODE);
Asoumy 2:7ace46b4f4f3 428 sprintf((char*)jour,"%02d",time.tm_mday);
Asoumy 1:2babe1d342dc 429 lcd.DisplayStringAt(30, 82, (uint8_t *)jour, LEFT_MODE);
Asoumy 1:2babe1d342dc 430 lcd.DisplayStringAt(65, 82, (uint8_t *)"/", LEFT_MODE);
Asoumy 2:7ace46b4f4f3 431 sprintf((char*)mois,"%02d",time.tm_mon);
Asoumy 1:2babe1d342dc 432 lcd.DisplayStringAt(80, 82, (uint8_t *) mois, LEFT_MODE);
Asoumy 1:2babe1d342dc 433 lcd.DisplayStringAt(115, 82, (uint8_t *)"/", LEFT_MODE);
Asoumy 2:7ace46b4f4f3 434 sprintf((char*)annee,"%04d",time.tm_year);
Asoumy 1:2babe1d342dc 435 lcd.DisplayStringAt(130, 82, (uint8_t *)annee, LEFT_MODE);
Asoumy 1:2babe1d342dc 436 lcd.DisplayStringAt(30, 135, (uint8_t *)"TIME:", LEFT_MODE);
Asoumy 1:2babe1d342dc 437 lcd.DisplayStringAt(65, 164, (uint8_t *)":", LEFT_MODE);
Asoumy 2:7ace46b4f4f3 438 sprintf((char*)minute,"%02d",time.tm_min);
Asoumy 1:2babe1d342dc 439 lcd.DisplayStringAt(80, 164, (uint8_t *)minute, LEFT_MODE);
Asoumy 1:2babe1d342dc 440 lcd.DisplayStringAt(115, 164, (uint8_t *)":", LEFT_MODE);
Asoumy 2:7ace46b4f4f3 441 sprintf((char*)seconde,"%02d",time.tm_sec);
Asoumy 1:2babe1d342dc 442 lcd.DisplayStringAt(130, 164, (uint8_t *)seconde, LEFT_MODE);
Asoumy 1:2babe1d342dc 443
Asoumy 1:2babe1d342dc 444 lcd.SetBackColor(LCD_COLOR_BLUE);
Asoumy 2:7ace46b4f4f3 445 sprintf((char*)heure,"%02d",time.tm_hour);
Asoumy 1:2babe1d342dc 446 lcd.DisplayStringAt(30, 164, (uint8_t *)heure, LEFT_MODE);
Asoumy 1:2babe1d342dc 447
Asoumy 2:7ace46b4f4f3 448
Asoumy 1:2babe1d342dc 449
Asoumy 1:2babe1d342dc 450 //AFFICHAGE DU BOUTON POUR AUGMENTER
Asoumy 1:2babe1d342dc 451 lcd.SetTextColor(LCD_COLOR_DARKBLUE);
Asoumy 1:2babe1d342dc 452 lcd.FillRect(145, 210, 80,30);
Asoumy 1:2babe1d342dc 453 lcd.SetBackColor(LCD_COLOR_DARKBLUE);
Asoumy 1:2babe1d342dc 454 lcd.SetTextColor(LCD_COLOR_WHITE);
Asoumy 1:2babe1d342dc 455 lcd.DisplayStringAt(145, LINE(9), (uint8_t *)" - ", LEFT_MODE);
Asoumy 1:2babe1d342dc 456
Asoumy 1:2babe1d342dc 457
Asoumy 1:2babe1d342dc 458 //AFFICHAGE DU BOUTON POUR DIMINUER
Asoumy 1:2babe1d342dc 459 lcd.SetTextColor(LCD_COLOR_DARKMAGENTA);
Asoumy 1:2babe1d342dc 460 lcd.FillRect(245, 210, 80,30);
Asoumy 1:2babe1d342dc 461 lcd.SetBackColor(LCD_COLOR_DARKMAGENTA);
Asoumy 1:2babe1d342dc 462 lcd.SetTextColor(LCD_COLOR_WHITE);
Asoumy 1:2babe1d342dc 463 lcd.DisplayStringAt(245, LINE(9), (uint8_t *)" + ", LEFT_MODE);
Asoumy 2:7ace46b4f4f3 464
Asoumy 1:2babe1d342dc 465 //AFFICHAGE DU BOUTON OK
Asoumy 1:2babe1d342dc 466 lcd.SetTextColor(LCD_COLOR_DARKGREEN);
Asoumy 1:2babe1d342dc 467 lcd.FillRect(360, 210, 80,30);
Asoumy 1:2babe1d342dc 468 lcd.SetBackColor(LCD_COLOR_DARKGREEN);
Asoumy 1:2babe1d342dc 469 lcd.SetTextColor(LCD_COLOR_WHITE);
Asoumy 1:2babe1d342dc 470 lcd.DisplayStringAt(360, LINE(9), (uint8_t *)" OK ", LEFT_MODE);
Asoumy 1:2babe1d342dc 471
Asoumy 1:2babe1d342dc 472
Asoumy 2:7ace46b4f4f3 473
Asoumy 1:2babe1d342dc 474 }
Asoumy 1:2babe1d342dc 475
Asoumy 1:2babe1d342dc 476 void Ecran2_Minutes()
Asoumy 1:2babe1d342dc 477 {
Asoumy 2:7ace46b4f4f3 478 struct tm time;
Asoumy 1:2babe1d342dc 479 lcd.Clear(LCD_COLOR_WHITE);
Asoumy 1:2babe1d342dc 480 lcd.SetTextColor(LCD_COLOR_BLACK);
Asoumy 1:2babe1d342dc 481 lcd.SetBackColor(LCD_COLOR_WHITE);
Asoumy 1:2babe1d342dc 482 lcd.DisplayStringAt(30, LINE(2), (uint8_t *)"DATE:", LEFT_MODE);
Asoumy 1:2babe1d342dc 483 sprintf(jour,"%02d",time.tm_mday);
Asoumy 1:2babe1d342dc 484 lcd.DisplayStringAt(30, 82, (uint8_t *)jour, LEFT_MODE);
Asoumy 1:2babe1d342dc 485 lcd.DisplayStringAt(65, 82, (uint8_t *)"/", LEFT_MODE);
Asoumy 1:2babe1d342dc 486 sprintf(mois,"%02d",time.tm_mon);
Asoumy 1:2babe1d342dc 487 lcd.DisplayStringAt(80, 82, (uint8_t *) mois, LEFT_MODE);
Asoumy 1:2babe1d342dc 488 lcd.DisplayStringAt(115, 82, (uint8_t *)"/", LEFT_MODE);
Asoumy 1:2babe1d342dc 489 sprintf(annee,"%04d",time.tm_year);
Asoumy 1:2babe1d342dc 490 lcd.DisplayStringAt(130, 82, (uint8_t *)annee, LEFT_MODE);
Asoumy 1:2babe1d342dc 491 lcd.DisplayStringAt(30, 135, (uint8_t *)"TIME:", LEFT_MODE);
Asoumy 1:2babe1d342dc 492 sprintf(heure,"%02d",time.tm_hour);
Asoumy 1:2babe1d342dc 493 lcd.DisplayStringAt(30, 164, (uint8_t *)heure, LEFT_MODE);
Asoumy 1:2babe1d342dc 494 lcd.DisplayStringAt(65, 164, (uint8_t *)":", LEFT_MODE);
Asoumy 1:2babe1d342dc 495 lcd.DisplayStringAt(115, 164, (uint8_t *)":", LEFT_MODE);
Asoumy 1:2babe1d342dc 496 sprintf(seconde,"%02d",time.tm_sec);
Asoumy 1:2babe1d342dc 497 lcd.DisplayStringAt(130, 164, (uint8_t *)seconde, LEFT_MODE);
Asoumy 1:2babe1d342dc 498
Asoumy 1:2babe1d342dc 499 lcd.SetBackColor(LCD_COLOR_BLUE);
Asoumy 1:2babe1d342dc 500 sprintf(minute,"%02d",time.tm_min);
Asoumy 1:2babe1d342dc 501 lcd.DisplayStringAt(80, 164, (uint8_t *)minute, LEFT_MODE);
Asoumy 2:7ace46b4f4f3 502
Asoumy 2:7ace46b4f4f3 503
Asoumy 1:2babe1d342dc 504
Asoumy 1:2babe1d342dc 505 //AFFICHAGE DU BOUTON POUR AUGMENTER
Asoumy 1:2babe1d342dc 506 lcd.SetTextColor(LCD_COLOR_DARKBLUE);
Asoumy 1:2babe1d342dc 507 lcd.FillRect(145, 210, 80,30);
Asoumy 1:2babe1d342dc 508 lcd.SetBackColor(LCD_COLOR_DARKBLUE);
Asoumy 1:2babe1d342dc 509 lcd.SetTextColor(LCD_COLOR_WHITE);
Asoumy 1:2babe1d342dc 510 lcd.DisplayStringAt(145, LINE(9), (uint8_t *)" - ", LEFT_MODE);
Asoumy 1:2babe1d342dc 511
Asoumy 1:2babe1d342dc 512
Asoumy 1:2babe1d342dc 513 //AFFICHAGE DU BOUTON POUR DIMINUER
Asoumy 1:2babe1d342dc 514 lcd.SetTextColor(LCD_COLOR_DARKMAGENTA);
Asoumy 1:2babe1d342dc 515 lcd.FillRect(245, 210, 80,30);
Asoumy 1:2babe1d342dc 516 lcd.SetBackColor(LCD_COLOR_DARKMAGENTA);
Asoumy 1:2babe1d342dc 517 lcd.SetTextColor(LCD_COLOR_WHITE);
Asoumy 1:2babe1d342dc 518 lcd.DisplayStringAt(245, LINE(9), (uint8_t *)" + ", LEFT_MODE);
Asoumy 2:7ace46b4f4f3 519
Asoumy 1:2babe1d342dc 520 //AFFICHAGE DU BOUTON OK
Asoumy 1:2babe1d342dc 521 lcd.SetTextColor(LCD_COLOR_DARKGREEN);
Asoumy 1:2babe1d342dc 522 lcd.FillRect(360, 210, 80,30);
Asoumy 1:2babe1d342dc 523 lcd.SetBackColor(LCD_COLOR_DARKGREEN);
Asoumy 1:2babe1d342dc 524 lcd.SetTextColor(LCD_COLOR_WHITE);
Asoumy 1:2babe1d342dc 525 lcd.DisplayStringAt(360, LINE(9), (uint8_t *)" OK ", LEFT_MODE);
Asoumy 1:2babe1d342dc 526 }
Asoumy 1:2babe1d342dc 527
Asoumy 1:2babe1d342dc 528 void Ecran2_Seconde()
Asoumy 1:2babe1d342dc 529 {
Asoumy 2:7ace46b4f4f3 530
Asoumy 2:7ace46b4f4f3 531 struct tm time;
Asoumy 2:7ace46b4f4f3 532 lcd.Clear(LCD_COLOR_WHITE);
Asoumy 1:2babe1d342dc 533 lcd.SetTextColor(LCD_COLOR_BLACK);
Asoumy 1:2babe1d342dc 534 lcd.SetBackColor(LCD_COLOR_WHITE);
Asoumy 1:2babe1d342dc 535 lcd.DisplayStringAt(30, LINE(2), (uint8_t *)"TIME:", LEFT_MODE);
Asoumy 1:2babe1d342dc 536 sprintf(jour,"%02d",time.tm_mday);
Asoumy 1:2babe1d342dc 537 lcd.DisplayStringAt(30, 82, (uint8_t *)jour, LEFT_MODE);
Asoumy 1:2babe1d342dc 538 lcd.DisplayStringAt(65, 82, (uint8_t *)"/", LEFT_MODE);
Asoumy 1:2babe1d342dc 539 sprintf(mois,"%02d",time.tm_mon);
Asoumy 1:2babe1d342dc 540 lcd.DisplayStringAt(80, 82, (uint8_t *) mois, LEFT_MODE);
Asoumy 1:2babe1d342dc 541 lcd.DisplayStringAt(115, 82, (uint8_t *)"/", LEFT_MODE);
Asoumy 1:2babe1d342dc 542 sprintf(annee," %04d",time.tm_year);
Asoumy 1:2babe1d342dc 543 lcd.DisplayStringAt(130, 82, (uint8_t *)annee, LEFT_MODE);
Asoumy 1:2babe1d342dc 544 lcd.DisplayStringAt(30, 135, (uint8_t *)"DATE:", LEFT_MODE);
Asoumy 1:2babe1d342dc 545 sprintf(heure,"%02d",time.tm_hour);
Asoumy 1:2babe1d342dc 546 lcd.DisplayStringAt(30, 164, (uint8_t *)heure, LEFT_MODE);
Asoumy 1:2babe1d342dc 547 lcd.DisplayStringAt(65, 164, (uint8_t *)":", LEFT_MODE);
Asoumy 1:2babe1d342dc 548 sprintf(minute,"%02d",time.tm_min);
Asoumy 1:2babe1d342dc 549 lcd.DisplayStringAt(80, 164, (uint8_t *)minute, LEFT_MODE);
Asoumy 1:2babe1d342dc 550 lcd.DisplayStringAt(115, 164, (uint8_t *)":", LEFT_MODE);
Asoumy 1:2babe1d342dc 551
Asoumy 1:2babe1d342dc 552 lcd.SetBackColor(LCD_COLOR_BLUE);
Asoumy 1:2babe1d342dc 553 sprintf(seconde,"%02d ",time.tm_sec);
Asoumy 1:2babe1d342dc 554 lcd.DisplayStringAt(130, 164, (uint8_t *)seconde, LEFT_MODE);
Asoumy 1:2babe1d342dc 555
Asoumy 2:7ace46b4f4f3 556
Asoumy 1:2babe1d342dc 557
Asoumy 1:2babe1d342dc 558 //AFFICHAGE DU BOUTON POUR AUGMENTER
Asoumy 1:2babe1d342dc 559 lcd.SetTextColor(LCD_COLOR_DARKBLUE);
Asoumy 1:2babe1d342dc 560 lcd.FillRect(145, 210, 80,30);
Asoumy 1:2babe1d342dc 561 lcd.SetBackColor(LCD_COLOR_DARKBLUE);
Asoumy 1:2babe1d342dc 562 lcd.SetTextColor(LCD_COLOR_WHITE);
Asoumy 1:2babe1d342dc 563 lcd.DisplayStringAt(145, LINE(9), (uint8_t *)" - ", LEFT_MODE);
Asoumy 1:2babe1d342dc 564
Asoumy 1:2babe1d342dc 565
Asoumy 1:2babe1d342dc 566 //AFFICHAGE DU BOUTON POUR DIMINUER
Asoumy 1:2babe1d342dc 567 lcd.SetTextColor(LCD_COLOR_DARKMAGENTA);
Asoumy 1:2babe1d342dc 568 lcd.FillRect(245, 210, 80,30);
Asoumy 1:2babe1d342dc 569 lcd.SetBackColor(LCD_COLOR_DARKMAGENTA);
Asoumy 1:2babe1d342dc 570 lcd.SetTextColor(LCD_COLOR_WHITE);
Asoumy 1:2babe1d342dc 571 lcd.DisplayStringAt(245, LINE(9), (uint8_t *)" + ", LEFT_MODE);
Asoumy 2:7ace46b4f4f3 572
Asoumy 1:2babe1d342dc 573 //AFFICHAGE DU BOUTON OK
Asoumy 1:2babe1d342dc 574 lcd.SetTextColor(LCD_COLOR_DARKGREEN);
Asoumy 1:2babe1d342dc 575 lcd.FillRect(360, 210, 80,30);
Asoumy 1:2babe1d342dc 576 lcd.SetBackColor(LCD_COLOR_DARKGREEN);
Asoumy 1:2babe1d342dc 577 lcd.SetTextColor(LCD_COLOR_WHITE);
Asoumy 2:7ace46b4f4f3 578 lcd.DisplayStringAt(360, LINE(9), (uint8_t *)" OK ", LEFT_MODE);
Asoumy 1:2babe1d342dc 579 }
Asoumy 1:2babe1d342dc 580
Asoumy 1:2babe1d342dc 581
Asoumy 1:2babe1d342dc 582 ///////FONCTION QUI AFFICHE LE NOUVEL ECRAN APRES L'APPUIE DE SUR FREQ
Asoumy 1:2babe1d342dc 583 void Ecran3()
Asoumy 1:2babe1d342dc 584 {
Asoumy 1:2babe1d342dc 585
Asoumy 1:2babe1d342dc 586 lcd.Clear(LCD_COLOR_WHITE);
Asoumy 1:2babe1d342dc 587 lcd.SetBackColor(LCD_COLOR_WHITE);
Asoumy 1:2babe1d342dc 588 lcd.SetTextColor(LCD_COLOR_DARKGRAY);
Asoumy 1:2babe1d342dc 589 lcd.DisplayStringAt(10, LINE(1), (uint8_t *)"Select the frequency of", CENTER_MODE);
Asoumy 1:2babe1d342dc 590 lcd.DisplayStringAt(10, LINE(2), (uint8_t *)"sending of the data on the", CENTER_MODE);
Asoumy 1:2babe1d342dc 591 lcd.DisplayStringAt(10, LINE(3), (uint8_t *)"SD card: ", CENTER_MODE);
Asoumy 2:7ace46b4f4f3 592 lcd.SetBackColor(LCD_COLOR_GREEN);
Asoumy 2:7ace46b4f4f3 593 lcd.DisplayStringAt(30,120, (uint8_t *)"Acquire ", LEFT_MODE);
Asoumy 2:7ace46b4f4f3 594 lcd.SetBackColor(LCD_COLOR_WHITE);
Asoumy 1:2babe1d342dc 595 lcd.DisplayStringAt(250, 120, (uint8_t *)"Per day", LEFT_MODE);
Asoumy 1:2babe1d342dc 596 lcd.DisplayStringAt(30, 160, (uint8_t *)"Per week ", LEFT_MODE);
Asoumy 1:2babe1d342dc 597 lcd.DisplayStringAt(250, 160, (uint8_t *)"Per month", LEFT_MODE);
Asoumy 1:2babe1d342dc 598
Asoumy 1:2babe1d342dc 599
Asoumy 1:2babe1d342dc 600 lcd.SetTextColor(LCD_COLOR_DARKRED);
Asoumy 1:2babe1d342dc 601 lcd.DrawRect(25, 115, 160, 30);
Asoumy 1:2babe1d342dc 602 lcd.DrawRect(245, 115, 160,30);
Asoumy 1:2babe1d342dc 603 lcd.DrawRect(25, 155, 160, 30);
Asoumy 1:2babe1d342dc 604 lcd.DrawRect(245, 155, 160,30);
Asoumy 1:2babe1d342dc 605
Asoumy 1:2babe1d342dc 606 //AFFICHAGE DU BOUTON RETOUR
Asoumy 1:2babe1d342dc 607
Asoumy 1:2babe1d342dc 608 lcd.SetBackColor(LCD_COLOR_DARKRED);
Asoumy 1:2babe1d342dc 609 lcd.SetTextColor(LCD_COLOR_WHITE);
Asoumy 1:2babe1d342dc 610 lcd.DisplayStringAt(30, LINE(9), (uint8_t *)"BACK", LEFT_MODE);
Asoumy 2:7ace46b4f4f3 611
Asoumy 2:7ace46b4f4f3 612 //AFFICHAGE DU BOUTON POUR VISUALISER la date
Asoumy 2:7ace46b4f4f3 613 lcd.SetBackColor(LCD_COLOR_BLACK);
Asoumy 2:7ace46b4f4f3 614 lcd.SetTextColor(LCD_COLOR_WHITE);
Asoumy 2:7ace46b4f4f3 615 lcd.DisplayStringAt(400,0 , (uint8_t *)"TIME", LEFT_MODE);
Asoumy 1:2babe1d342dc 616 }
Asoumy 1:2babe1d342dc 617
Asoumy 1:2babe1d342dc 618 void Ecran3_PerHour()
Asoumy 1:2babe1d342dc 619 {
Asoumy 1:2babe1d342dc 620
Asoumy 1:2babe1d342dc 621 }
Asoumy 1:2babe1d342dc 622 void Ecran3_PerDay()
Asoumy 1:2babe1d342dc 623 {
Asoumy 1:2babe1d342dc 624
Asoumy 1:2babe1d342dc 625 }
Asoumy 1:2babe1d342dc 626 void Ecran3_PerWeek()
Asoumy 1:2babe1d342dc 627 {
Asoumy 1:2babe1d342dc 628
Asoumy 1:2babe1d342dc 629 }
Asoumy 1:2babe1d342dc 630 void Ecran3_PerMonth()
Asoumy 1:2babe1d342dc 631 {
Asoumy 1:2babe1d342dc 632
Asoumy 1:2babe1d342dc 633 }
Asoumy 1:2babe1d342dc 634
Asoumy 2:7ace46b4f4f3 635 ////FONCTION QUI AFFICHE LE MOT DE PASSE///////
Asoumy 2:7ace46b4f4f3 636 void MotDePasse()
Asoumy 2:7ace46b4f4f3 637 {
Asoumy 2:7ace46b4f4f3 638 lcd.Clear(LCD_COLOR_WHITE);
Asoumy 2:7ace46b4f4f3 639 lcd.SetBackColor(LCD_COLOR_WHITE);
Asoumy 2:7ace46b4f4f3 640 lcd.SetTextColor(LCD_COLOR_BLACK);
Asoumy 2:7ace46b4f4f3 641 lcd.DisplayStringAt(0, LINE(1), (uint8_t *)" PASSWORD: ",LEFT_MODE);
Asoumy 1:2babe1d342dc 642
Asoumy 2:7ace46b4f4f3 643 lcd.SetTextColor(LCD_COLOR_BLACK);
Asoumy 2:7ace46b4f4f3 644 lcd.FillRect(120, 80, 240, 160);
Asoumy 2:7ace46b4f4f3 645
Asoumy 2:7ace46b4f4f3 646 lcd.SetBackColor(LCD_COLOR_DARKGRAY);
Asoumy 2:7ace46b4f4f3 647 lcd.SetTextColor(LCD_COLOR_WHITE);
Asoumy 2:7ace46b4f4f3 648 lcd.DisplayStringAt(135,90, (uint8_t *)" 1 ", LEFT_MODE);
Asoumy 2:7ace46b4f4f3 649 lcd.DisplayStringAt(215, 90, (uint8_t *)" 2 ", LEFT_MODE);
Asoumy 2:7ace46b4f4f3 650 lcd.DisplayStringAt(295, 90, (uint8_t *)" 3 ", LEFT_MODE);
Asoumy 2:7ace46b4f4f3 651 lcd.DisplayStringAt(135,130, (uint8_t *)" 4 ", LEFT_MODE);
Asoumy 2:7ace46b4f4f3 652 lcd.DisplayStringAt(215, 130, (uint8_t *)" 5 ", LEFT_MODE);
Asoumy 2:7ace46b4f4f3 653 lcd.DisplayStringAt(295, 130, (uint8_t *)" 6 ", LEFT_MODE);
Asoumy 2:7ace46b4f4f3 654 lcd.DisplayStringAt(135, 170, (uint8_t *)" 7 ", LEFT_MODE);
Asoumy 2:7ace46b4f4f3 655 lcd.DisplayStringAt(215, 170, (uint8_t *)" 8 ", LEFT_MODE);
Asoumy 2:7ace46b4f4f3 656 lcd.DisplayStringAt(295, 170, (uint8_t *)" 9 ", LEFT_MODE);
Asoumy 1:2babe1d342dc 657
Asoumy 2:7ace46b4f4f3 658 lcd.SetBackColor(LCD_COLOR_GREEN);
Asoumy 1:2babe1d342dc 659 lcd.SetTextColor(LCD_COLOR_WHITE);
Asoumy 2:7ace46b4f4f3 660 lcd.DisplayStringAt(210, 210, (uint8_t *)" OK ", LEFT_MODE);
Asoumy 2:7ace46b4f4f3 661
Asoumy 2:7ace46b4f4f3 662 //AFFICHAGE DU BOUTON RETOUR
Asoumy 2:7ace46b4f4f3 663 lcd.SetTextColor(LCD_COLOR_DARKRED);
Asoumy 2:7ace46b4f4f3 664 lcd.FillRect(30, 210, 80,30);
Asoumy 2:7ace46b4f4f3 665 lcd.SetBackColor(LCD_COLOR_DARKRED);
Asoumy 2:7ace46b4f4f3 666 lcd.SetTextColor(LCD_COLOR_WHITE);
Asoumy 2:7ace46b4f4f3 667 lcd.DisplayStringAt(30, LINE(9), (uint8_t *)"BACK", LEFT_MODE);
Asoumy 2:7ace46b4f4f3 668 }
Asoumy 2:7ace46b4f4f3 669 ///////////////////////////////////////////////////////////////////
Asoumy 2:7ace46b4f4f3 670