From 5c146c37566c16d224ad8107124aa3a8fbc9e737 Mon Sep 17 00:00:00 2001 From: Thibaud LA RIVIERE-GILLET Date: Thu, 16 May 2024 11:01:25 +0200 Subject: [PATCH] Update 'script/script.ino' --- script/script.ino | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/script/script.ino b/script/script.ino index 7dd1337..28f8dde 100644 --- a/script/script.ino +++ b/script/script.ino @@ -25,8 +25,6 @@ String hourString; void setup() { Serial.begin(115200); - - rtc.adjust(now); now = rtc.now(); @@ -38,10 +36,11 @@ void setup() { tft.setRotation(3); tft.setTextColor(TFT_BLACK); tft.setTextSize(3); - while (!Serial){ - tft.fillScreen(TFT_GREEN); - tft.drawString("Need serial com", 10, 10); - } + + tft.fillScreen(TFT_GREEN); + tft.drawString("Need serial com", 10, 10); + while (!Serial) + continue; pinMode(WIO_KEY_A, INPUT_PULLUP); pinMode(WIO_KEY_B, INPUT_PULLUP); @@ -86,7 +85,8 @@ void add() if (actuel <= maxAffluence){ tft.fillRect(0,41,320,240,TFT_GREEN); } - else{ + else + { tft.fillRect(0,41,320,240,TFT_RED); } tft.drawString("affluence: " + String(actuel), 20, 75); @@ -105,9 +105,9 @@ void substract() } else{ tft.fillRect(0,41,320,240,TFT_RED); + } tft.drawString("affluence: " + String(actuel), 20, 75); tft.drawString("visiteurs: " + String(visiteurs), 20, 100); - } } } @@ -150,14 +150,14 @@ void loop() { delay(1000); second++; Serial.println(second); - if (second%60 == 0){ + if (second%60 == 0) + { minute++; - if (minute%60 == 0){ + if (minute%60 == 0) hour++; - } - if (hour == 24){ + if (hour%24 == 0) hour = 0; - } + bar(); } }