user49023: Here's my code 
void loop() {
  if (analogRead(A0) > 500)
  {
    statuss = true ;
  }
  if (statuss)
  {
    digitalWrite(D7, HIGH);
    if (millis() - lasttime > 500)
    {
      digitalWrite(D8, etat);
      digitalWrite(D6, etat);
      etat = !etat;
      lasttime = millis();
    }
  }
  server.handleClient();
}

When I use only server.handleClient everything works fine but when I add any type of code to the loop() function the server goes down and I can't see the ESP8266 access point.

user37622: The problem is analogRead. The esp8266 uses the ADC to evaluate the strength of the WiFi signal. Hard use of analogRead disturbs it and the signal goes down. Use millis() to time analogRead.
unsigned int tempSensRead() {

  const unsigned long MEASURE_INTERVAL = 2L * 1000 * 60; // 2 minutes
  static unsigned long lastMeasureMillis;
  static unsigned int lastValue;

  if (millis() - lastMeasureMillis > MEASURE_INTERVAL) {
    lastMeasureMillis = millis();
    lastValue = analogRead(A0);
  }
  return lastValue;
}


49023: <p>Here's my code </p>

<pre><code>void loop() {
  if (analogRead(A0) &gt; 500)
  {
    statuss = true ;
  }
  if (statuss)
  {
    digitalWrite(D7, HIGH);
    if (millis() - lasttime &gt; 500)
    {
      digitalWrite(D8, etat);
      digitalWrite(D6, etat);
      etat = !etat;
      lasttime = millis();
    }
  }
  server.handleClient();
}
</code></pre>

<p>When I use only <code>server.handleClient</code> everything works fine but when I add any type of code to the <code>loop()</code> function the server goes down and I can't see the ESP8266 access point.</p>
 37622: <p>The problem is analogRead. The esp8266 uses the ADC to evaluate the strength of the WiFi signal. Hard use of analogRead disturbs it and the signal goes down. Use millis() to time analogRead.</p>

<pre><code>unsigned int tempSensRead() {

  const unsigned long MEASURE_INTERVAL = 2L * 1000 * 60; // 2 minutes
  static unsigned long lastMeasureMillis;
  static unsigned int lastValue;

  if (millis() - lastMeasureMillis &gt; MEASURE_INTERVAL) {
    lastMeasureMillis = millis();
    lastValue = analogRead(A0);
  }
  return lastValue;
}
</code></pre>
