-// Hygrometer
+// Arduino Hygrometer
 // version: 0.1
 // Author: Mika Hassinen
 
 
 #define TIME_INTERVAL 1000	// 1000 ms interval
+#define FLASH_TIME_INTERVAL 400	// 400 ms flash interval
 #define ENABLER_PIN 2		// output pin that enables the sensor while reading the value
 #define SENSOR_PIN A1		// input pin for the sensor
+#define LOW_LEVEL_THRESHOLD 200	// minimum threshold for the water level (=desert dry soil)
 
 int ledPins[] = {3, 4, 5, 6, 7};
 

			digitalWrite(ledPins[pin], LOW);
	}
}

		timer = currentTime;
	}

	// flash red LED if water level is below threshold
	if ((unsigned long)(currentTime - flashTimer) >= FLASH_TIME_INTERVAL) {

		if (sensorValue < LOW_LEVEL_THRESHOLD) {
			if (blink)
				setLedLevel(1);	// turn on first (red) LED
			else
				setLedLevel(0); // turn off all LEDs

			blink = !blink;
		}

		flashTimer = currentTime;
	}

}

/**
 * Ligts LEDs according to given level where 0 is all LEDs are OFF and 5 is all LEDs are ON
 * @param Integer level number of leds to light up from 0 to 5
 */
void setLedLevel(int level) {
	int ledArraySize = (sizeof(ledPins)/sizeof(int));
	if (level < 0) level = 0;
	if (level > (ledArraySize) ) level = ledArraySize;

	for (int pin = 0; pin < ledArraySize; pin++ ) {
		pinMode(ledPins[pin], OUTPUT);
