     else setHumidity();
   }
   
-//  delay(1000);
-  
   // Draw one current digit on display
   activateDigit(INACTIVE);
   drawDigit(digits[currentDigitIndex], decimalPoints[currentDigitIndex]);


int readData() {
  temperature = 234; // 1=0.1, -1=-0.1, 12=1.2, -12=-1.2, 123=12.3, -123=-12, 1234=123, -1234=err, 12345=err, -12345=err
  humidity = 463;
  
  return 0;
}

}

void setHumidity() {
  if (humidity < 0) humidity = 0;
  else if (humidity > 1000) humidity = 1000;

  String textHumidity = String(humidity);
  int textLength = textHumidity.length();
  if (textLength == 0) {
    textHumidity = "00";
    textLength = 2;
  }
  else if (textLength == 1) {
    textHumidity = "0" + textHumidity;
    textLength = 2;
  }

  boolean hasDecimalPoint;
  if (humidity == 1000) {
    digits[0] = 1;
    digits[1] = 0;
    digits[2] = 0;
    digits[3] = HUMIDITY_SYMBOL;
    hasDecimalPoint = false;
  } else {
    if (textLength == 2) digits[0] = NOTHING_SYMBOL;
    else digits[0] = String(textHumidity.charAt(textLength - 3)).toInt();
    digits[1] = String(textHumidity.charAt(textLength - 2)).toInt();
    digits[2] = String(textHumidity.charAt(textLength - 1)).toInt();
    digits[3] = HUMIDITY_SYMBOL;
    hasDecimalPoint = true;
  }
  
  decimalPoints[0] = false;
  decimalPoints[1] = hasDecimalPoint;
  decimalPoints[2] = false;
  decimalPoints[3] = false;
}
