I'm playing around with this udp-example. Both this and the blink-example work perfectly. Now I would like to use the LED to indicate what the ESP is currently doing, as well as reading some data over Serial. My code looks like this:
void setup(){
Serial.begin(115200);
Serial.setTimeout(500);
while(Serial.available()==0){
}
String password = Serial.readStringUntil('.');
Serial.println(password);
WiFi.begin(ssid.c_str(), password.c_str());
//pinMode(LED_BUILTIN, OUTPUT);
while (WiFi.status() != WL_CONNECTED){
//digitalWrite(LED_BUILTIN, LOW);
delay(250);
//digitalWrite(LED_BUILTIN, HIGH);
delay (250);
}
Serial.println("connected");
Udp.begin(localUdpPort);
}
It works fine, but if I uncomment the led-lines the serial communication doesn't seem to work anymore. All the stuff that is printed on the Serial Monitor is now messed up (missing characters, ...). Is there a problem with my code or what else could be possible going wrong here?
EDIT: I recently tried the same code again, but used an additional power supply (3.3V, 500mA) for the chip. However, this didn't resolve the problem.
setTimeout
call.