 // Arduino Hygrometer
-// version: 1.0
+// version: 1.0.1
 // Author: Mika Hassinen
 
 #include <FastLED.h>

 * @return Integer
 */
int readSensor(int sensorPin, int min, int max) {

	int average;
	float sensorValue, sum;
	for (int i = 0; i < 50; i++) {
		sensorValue = analogRead(sensorPin);
		sum += sensorValue;

void setup() {

	// setup sensors as inputs
	pinMode(MOISTURE_SENSOR_PIN, INPUT);
	pinMode(PHOTORESISTOR_PIN, INPUT);

	// set initial values
	sensorValue = MOISTURE_LEVEL_MAX;
	brightnessValue = 1024;

	// Serial.print("test led");
	FastLED.addLeds<NEOPIXEL, DATA_PIN>(smartLed, NUM_LEDS);
	setLedLevel(10);
	delay(400); // add a short delay so the transition to real led level is more subtle
	for (int i = 0; i < MAX_LED_VALUE; i+=10) {
		setLedLevel(i);
		delay(100);
	}
	delay(400);
	smartLed[0].setRGB(230, 230, 250);  // purple
	FastLED.show();
	delay(400);
}

void loop() {
