 		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;
+	if (level > (ledArraySize) ) level = ledArraySize;
 
 	for (int pin = 0; pin < ledArraySize; pin++ ) {
 		pinMode(ledPins[pin], OUTPUT);

// Hygrometer
// version: 0.1
// Author: Mika Hassinen


#define TIME_INTERVAL 1000	// 1000 ms interval
#define ENABLER_PIN 2		// output pin that enables the sensor while reading the value
#define SENSOR_PIN A1		// input pin for the sensor

int ledPins[] = {3, 4, 5, 6, 7};


	// test leds
	for (int pin = 0; pin < (sizeof(ledPins)/sizeof(int)); pin++ ) {
		pinMode(ledPins[pin], OUTPUT);
		delay(150);	// light up each LED in 0.15 second intervals
		digitalWrite(ledPins[pin], HIGH);
	}
	delay(1000);	// show all LEDs on for a second
	setLedLevel(0);

	// test sensor
	digitalWrite(ENABLER_PIN, HIGH);
	delay(100);
	sensorValue = readSensor();
	Serial.print("[DEBUG]: test read value: ");
	Serial.println(sensorValue);
	digitalWrite(ENABLER_PIN, LOW);
