Update 'script/script.ino'

master
parent 5c146c3756
commit 304b1e4182

@ -14,7 +14,7 @@ short second = 0;
unsigned int actuel = 0; unsigned int actuel = 0;
unsigned int visiteurs = 0; unsigned int visiteurs = 0;
const unsigned short maxAffluence = 15; const unsigned short maxAffluence = 10;
int resetTime; int resetTime;
String minuteString; String minuteString;
@ -82,12 +82,19 @@ void add()
visiteurs++; visiteurs++;
actuel++; actuel++;
if (actuel <= maxAffluence){ if (actuel <= maxAffluence)
{
tft.fillRect(0,41,320,240,TFT_GREEN); tft.fillRect(0,41,320,240,TFT_GREEN);
} }
else else
{ {
tft.fillRect(0,41,320,240,TFT_RED); tft.fillRect(0,41,320,240,TFT_RED);
if (actuel == maxAffluence + 1)
{
analogWrite(WIO_BUZZER, 128);
delay(100000);
analogWrite(WIO_BUZZER, LOW);
}
} }
tft.drawString("affluence: " + String(actuel), 20, 75); tft.drawString("affluence: " + String(actuel), 20, 75);
tft.drawString("visiteurs: " + String(visiteurs), 20, 100); tft.drawString("visiteurs: " + String(visiteurs), 20, 100);
@ -100,10 +107,18 @@ void substract()
{ {
actuel--; actuel--;
if (actuel <= maxAffluence){ if (actuel <= maxAffluence)
{
tft.fillRect(0,41,320,240,TFT_GREEN); tft.fillRect(0,41,320,240,TFT_GREEN);
if (actuel == maxAffluence)
{
analogWrite(WIO_BUZZER, 128);
delay(100000);
analogWrite(WIO_BUZZER, LOW);
} }
else{ }
else
{
tft.fillRect(0,41,320,240,TFT_RED); tft.fillRect(0,41,320,240,TFT_RED);
} }
tft.drawString("affluence: " + String(actuel), 20, 75); tft.drawString("affluence: " + String(actuel), 20, 75);

Loading…
Cancel
Save