 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 = 100; // increase the value to reduce current
-
-const short MINUS = -1;
-const short DEGREE = -2;
+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];
-
-int temperature = -23;
-int humidity = 46;
+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) {

  pinMode(SEGMENT_E_PIN, OUTPUT);
  pinMode(SEGMENT_F_PIN, OUTPUT);
  pinMode(SEGMENT_G_PIN, OUTPUT);
  
  analogWrite(DIGIT_1_PIN, DIGIT_OFF);
  analogWrite(DIGIT_2_PIN, DIGIT_OFF);

      digitalWrite(SEGMENT_F_PIN, LOW);
      digitalWrite(SEGMENT_G_PIN, LOW);
  }
  digitalWrite(SEGMENT_DP_PIN, hasDecimalPoint ? HIGH : LOW);
}

int readData() {
  temperature = -23;
  humidity = 463;
  
  return 0;
}

void setErrorCode(int errorCode) {
  digits[0] = E_SYMBOL;
  digits[1] = R_SYMBOL;
  digits[2] = R_SYMBOL;
  digits[3] = 5;
}  

void setTemperature() {
  digits[0] = MINUS_SYMBOL;
  digits[1] = 2;
  digits[2] = 3;
  digits[3] = DEGREE_SYMBOL;
  
  decimalPoints[0] = false;
  decimalPoints[1] = true;
  decimalPoints[2] = false;
  decimalPoints[3] = false;
}

void setHumidity() {
  digits[0] = 4;
  digits[1] = 6;
  digits[2] = 3;
  digits[3] = HUMIDITY_SYMBOL;
  
  decimalPoints[0] = false;
  decimalPoints[1] = true;
  decimalPoints[2] = false;
  decimalPoints[3] = false;
}

void setup() {
