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

  digitalWrite(enable_sensor_pin, LOW);
}

void send_packet(int sample) {
  Serial.print(F("Sending sample: "));
  Serial.println(sample);

  ble.print("AT+BLEUARTTX=");
  ble.print("B");
  ble.print(sample);
  ble.println("E");
  if (!ble.waitForOK())
    Serial.println(F("Failed to send?"));
}

void loop() {
  int samples[NUM_SAMPLES];
  read_sensor(samples);

  for (int i = 0; i < NUM_SAMPLES; i++)
    send_packet(samples[i]);

  delay(30 * 1000);

  if (!ble.isConnected()) {
    Serial.println(F("Disconnected!"));
    connect_to_host();
  }
}


                              BLUEFRUIT_UART_MODE_PIN,
                              BLUEFRUIT_UART_CTS_PIN,
                              BLUEFRUIT_UART_RTS_PIN);

/** Prints an error and ends the execution. */
void error(const __FlashStringHelper* err) {
  Serial.println(err);
  while (1);
}                              

/** Waits until making a connection with the host. */
void connect_to_host() {
  ble.reset();
  ble.echo(false);
  Serial.println(F("Requesting Bluefruit info:"));
  ble.info();
  ble.verbose(false);
  
  Serial.println(F("Waiting for connection"));
  while (!ble.isConnected())
    delay(500);
  Serial.println(F("Connected"));

  if (ble.isVersionAtLeast(MINIMUM_FIRMWARE_VERSION)) {
