From 36b4a2c73c39e64619d2ba326004a342bb21d7c7 Mon Sep 17 00:00:00 2001 From: Adryen DECHANDON Date: Tue, 14 May 2024 15:59:53 +0200 Subject: [PATCH] =?UTF-8?q?Mise=20=C3=A0=20jour=20de=20'sujet'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sujet | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/sujet b/sujet index 63c29c9..fbae256 100644 --- a/sujet +++ b/sujet @@ -8,6 +8,8 @@ int affluence = 0; // Initialize affluence to 0 int ancien_visit_total = 0; int ancien_affluence = 0; int y = Y_MAX/5; +int background = TFT_GREEN; + unsigned long myTimeInSec; unsigned long myTimeInMin; @@ -18,7 +20,7 @@ unsigned long hour; void setup() { tft.begin(); tft.setRotation(3); // Set the screen orientation - tft.fillScreen(TFT_GREEN); // Green background + tft.fillScreen(background); // Green background pinMode(WIO_KEY_A, INPUT_PULLUP); pinMode(WIO_KEY_B, INPUT_PULLUP); pinMode(WIO_KEY_C, INPUT_PULLUP); @@ -68,6 +70,14 @@ void visiteur() { Serial.println("impossible d'être négatif !"); affluence = 0; } + if(affluence < 10){ + Serial.println("attention l'affluence à dépassé 10 !"); + background = TFT_GREEN; + tft.fillScreen(background); // Green background + affiche(); + affBandeauBleu(); + affHeure(); + } efface(); affiche(); Serial.print("visit_total = "); @@ -80,6 +90,11 @@ void visiteur() { visit_total = visit_total +1; // Increment visit_total if(affluence > 10){ Serial.println("attention l'affluence à dépassé 10 !"); + background = TFT_RED; + tft.fillScreen(background); // Green background + affiche(); + affBandeauBleu(); + affHeure(); } efface(); affiche(); @@ -99,7 +114,7 @@ void visiteur() { etat = 0; } - tft.setTextColor(TFT_GREEN); + tft.setTextColor(background); tft.setTextSize(3); tft.drawString("Confirmez ?", 110, 200); efface(); @@ -117,7 +132,7 @@ void ancien(){ ancien_affluence = affluence; } void efface(){ - tft.setTextColor(TFT_GREEN); + tft.setTextColor(background); tft.setTextSize(3); tft.drawString("visit_total", 10, 100); tft.drawNumber(ancien_visit_total, 250, 100);