       bufindex = 0;
     }
     if(bufindex >= 64) bufindex=0;
-  } else if (!isAsleep) {
-    sleep();
-  }
+
+  } else sleep();
 }
 
 


char buf[64];
int8_t bufindex;
boolean isAsleep = false;

void setup() {
  pinMode(11, OUTPUT);

// SERVO SLEEP

int sleep_timer = 0;
boolean isAsleep = false;

void sleep() {
  if (!isAsleep) {
    sleep_timer++;
    delay(100);
    if (sleep_timer > MS_BEFORE_SERVO_SLEEP / 100) {
      isAsleep = true;
      servoPen.detach();
      Serial.print('good night !');
    }
  }
}

void wakeUp() {
  if (isAsleep) {
    sleep_timer = 0;
    isAsleep = false;
    servoPen.attach(servopin);
  }
}


