       error(F("Couldn't factory reset"));
     }
   }
-
-  connect_to_host();
   
   pinMode(enable_sensor_pin, OUTPUT);
 }
 
-int read_sensor(int samples[]) {
-  Serial.println(F("-- Enabling sensor --"));
+/** Reads samples from the sensor.
+ *  
+ *  @param samples The array where to store the samples.
+ */
+void read_sensor(int samples[]) {
+  Serial.println(F("-- Enabling sensor and waiting for warm-up --"));
   digitalWrite(enable_sensor_pin, HIGH);
+  delay(WARMUP_TIME);
+  
   for (int i = 0; i < NUM_SAMPLES; i++) {
-    delay(500);
+    delay(DELAY_BETWEEN_SAMPLES);
     samples[i] = analogRead(sensor_pin);
     Serial.print(F("Sensor value: "));
     Serial.println(samples[i]);

#define MINIMUM_FIRMWARE_VERSION    "0.6.6"
#define MODE_LED_BEHAVIOUR          "MODE"

#define NUM_SAMPLES 50
const int sensor_pin = A0;
const int enable_sensor_pin = 7;


  }
}

/** Setup method. */
void setup() {
  while (!Serial);
  delay(500);
