I have simple example, where in loop is called webServer to handle clients and also text drawing on display. The thing is that webServer is not responding, but when I remove second part of loop - drawing text to display then web server starts to work normally.
Server does not respond:
void loop() {
server.handleClient();
unsigned long timeNow = millis();
if ((timeNow > screenChangeTime)) {
display.clear();
display.setFont(ArialMT_Plain_16);
display.setTextAlignment(TEXT_ALIGN_CENTER);
display.drawString(12, 20,"Loaded: "+String(particles));
screenChangeTime= timeNow + delay;
display.display();
}
}
Server responds:
void loop() {
server.handleClient();
}
if ((millis() - previousTime) >= screenChangeTime) { previousTime += screenChangeTime; ... }
) – frarugi87 Feb 13 '18 at 13:06screenChangeTime
variable is notunsigned long
(even if I doubt that it isn't) it has problems much sooner. In any case, I know it is not the issue here, and in fact it was a comment, not an answer. – frarugi87 Sep 29 '18 at 11:53