-const int DIGIT_DELAY = 500;
+const int DIGIT_DELAY_IN_MICROSECONDS = 500;
+const int MODE_DURATION_IN_MILLIS = 5000; // temperature / humidity modes
 
 const int DIGIT_1_PIN = 3;
 const int DIGIT_2_PIN = 5;

  digitalWrite(SEGMENT_E_PIN, HIGH);
  digitalWrite(SEGMENT_F_PIN, HIGH);
  digitalWrite(SEGMENT_G_PIN, HIGH);
  
  digits[0] = MINUS;
  digits[1] = 2;
  digits[2] = 3;
  digits[3] = DEGREE;
}

void loop() {
  activateDigit(INACTIVE);
  drawDigit(digits[currentDigitIndex]);
  activateDigit(currentDigitIndex);
  
  currentDigitIndex++;
  if (currentDigitIndex >= 4) currentDigitIndex = 0;
  
  delayMicroseconds(DIGIT_DELAY);
}

const int SEGMENT_E_PIN = 12;
const int SEGMENT_F_PIN = 7;
const int SEGMENT_G_PIN = 13;
const int SEGMENT_DP_PIN = 4;

const byte DIGIT_OFF = 255;
const byte DIGIT_ON = 0; // increase the value to reduce current

const short MINUS_SYMBOL = -1;
const short DEGREE_SYMBOL = -2;
const short HUMIDITY_SYMBOL = -3;
const short NOTHING_SYMBOL = -4;
const short E_SYMBOL = -5;
const short R_SYMBOL = -6;

int currentDigitIndex = 0;
const int INACTIVE = -1;
short digits[4];
boolean decimalPoints[4];

int temperature = -23; // real temperature * 10
int humidity = 463;    // real humidity * 10
long startModeMillis;

enum Mode {
  TEMPERATURE, HUMIDITY
};
Mode mode;

void activateDigit(int digit) {
  switch (digit) {
