Update 'script/script.ino'

master
parent 3505ced419
commit 5c146c3756

@ -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();
}
}

Loading…
Cancel
Save