:o
ben vous essayez de faire cela
/////////////////////////
/// horloge /////////////
/////////////////////////
DateTime now = RTC.now();
DateTime heureRTC;
heureRTC = RTC.now(); ///heureRTC = RTC1307.now();
/////////////////////////
////////////////////// HEURE /////////////////////////////////////
tft.setTextColor(RED, BLACK); tft.setTextSize(2);
tft.setCursor(15, 5); tft.print(now.hour()); tft.print(":");
if (now.minute() < 10) {
tft.print("0");
}
tft.print(now.minute()); tft.print(":");
if (now.second() < 10) {
tft.print("0");
}
tft.print(now.second());
////////////////////// DATE /////////////////////////////////////
tft.setTextColor(RED, BLACK); tft.setTextSize(2);
tft.setCursor(170, 5);
tft.print(now.day());
switch (now.month()) {
case 1:
tft.print("/1 /");
break;
case 2:
tft.print("/2/");
break;
case 3:
tft.print("/3/");
break;
case 4:
tft.print("/4/");
break;
case 5:
tft.print("/5/");
break;
case 6:
tft.print("/6/");
break;
case 7:
tft.print("/7/");
break;
case 8:
tft.print("/8/");
break;
case 9:
tft.print("/9/");
break;
case 10:
tft.print("/10/");
break;
case 11:
tft.print("/11/");
break;
case 12:
tft.print("/12/");
break;
}
tft.print(now.year());
des milliers de fois par seconde alors qu’une fois toute les secondes ce serait bien suffisant par exemple et uniquement pour les éléments qui changent (par exemple que les secondes si vous êtes passé de 12 à 13s, pas la peine de ré-afficher toute la date)
il semble que vous prenez un malin plaisir à effacer tout l’écran pour tout redessiner…
de plus il y a au moins une boucle infinie…
if ((choix_0 == 1) ) {
while (choix_0 == 1) {
////////////////////////////
digitalWrite(13, HIGH);
TSPoint p = ts.getPoint();
digitalWrite(13, LOW);
pinMode(XM, OUTPUT);
pinMode(YP, OUTPUT);
p.x = map(p.x, TS_MINX, TS_MAXX, 0, 240);
p.y = map(p.y, TS_MINY, TS_MAXY, 0, 320);
////////////////////////////
//Serial.print(" x= "); Serial.print(p.x); Serial.print(" y= "); Serial.println(p.y + 25);
if (p.z > MINPRESSURE && p.z < MAXPRESSURE )
{
//Serial.println(" dans le while ");
if ( (p.x > 150 && p.x < 180 && p.y + 25 > 270 && p.y + 25 < 300) ) {
TempSeuilAlarmeHaute++;
}
if ( ( p.x > 190 && p.x < 220 && p.y + 25 > 270 && p.y + 25 < 300) ) {
TempSeuilAlarmeHaute--;
}
////////////
tft.fillRect(10, 195, 30, 30, WHITE);
if (( p.x > 200 && p.x < 230 && p.y + 25 > 15 && p.y + 25 < 50) ) {
choix_1 = 0;
break;
}
}
tft.setCursor(65, 175); tft.setTextColor(RED, BLACK); tft.setTextSize(2); tft.print("Consigne : "); tft.print(TempSeuilAlarmeHaute);
}
}
dans ce while vous ne modifiez jamais choix_0 donc si vous y entrez vous n’en sortirez plus…
==> un peu de boulot pour remettre cela en forme