     cabinsTotalClosed++;
     if (CABIN_2_WAS_OPENED) {
       CABIN_2_WAS_OPENED = false;
-      if (CABIN_2_CLOSED_COUNTER == 999) {
-        CABIN_2_CLOSED_COUNTER = 0;
-      }
       CABIN_2_CLOSED_COUNTER++;
     }
   } else {

  }
}

// https://forum.arduino.cc/index.php?topic=345964.0
void shuffleArray(int * array, int size) {
  randomSeed(analogRead(A0));

  int last = 0;
  int temp = array[last];
  for (int i = 0; i < size; i++) {
    int index = random(size);
    array[last] = array[index];
    last = index;
  }
  array[last] = temp;
}

void showOnMatrixSinceUpdated() {
  // String target = (String) matrixLedLocations[matrixLedLocationsCurrentIndex];
  // matrixLedLocationsCurrentIndex++;

  matrix.drawPixel(matrixLedOffXIndex, matrixLedOffYIndex, LED_YELLOW);
  matrix.writeDisplay();
  delay(15);
  matrix.drawPixel(matrixLedOffXIndex, matrixLedOffYIndex, 0);

#include "ESP8266WebServer.h"
#include "Adafruit_GFX.h"
#include "Adafruit_LEDBackpack.h"
#include <SimpleTimer.h>
#include <ArduinoJson.h>

// #define SERIAL_VERBOSE

const char *WLAN_SSID = "Pukpukus";
const char *WLAN_PWD  = "********";
// NETWORK: Static IP details
// @see https://forum.arduino.cc/index.php?topic=460595.0
IPAddress staticIp(      1, 2, 3, 4);
IPAddress defaultGateway(1, 2, 3, 1);
IPAddress netmask(255, 255, 255, 0);

bool CABIN_1_CLOSED = false;
bool CABIN_2_CLOSED = false;
uint32_t CABIN_1_CLOSED_COUNTER = 0;
uint32_t CABIN_2_CLOSED_COUNTER = 0;
bool CABIN_1_WAS_OPENED = true;
bool CABIN_2_WAS_OPENED = true;
uint8_t CABIN_TOTAL_COUNT = 2; // we got total 2 cabins

uint32_t TS_UPTIME_PREVIOUS = 0;
uint32_t TS_UPTIME_OVERLAPS = 0;
uint32_t TS_LAST_UPDATED = 0;
uint32_t TS_LAST_UPDATED_OVERLAPS = 0;

// need this to correct "burn" effect
uint8_t CURRENT_MATRIX_COLOR = 0;

// https://www.adafruit.com/product/902
Adafruit_BicolorMatrix matrix = Adafruit_BicolorMatrix();
