void loopTask_Cmd(void *pvParameters) {
Serial.println("Task Cmd_Server is starting ... ");
while (1) {
WiFiClient client = server_Cmd.available(); // listen for incoming clients
if (client) { // if you get a client,
Serial.println("Command Server connected to a client.");// print a message out the
serial port
String currentLine = ""; // make a String to hold incoming data from the client
while (client.connected()) { // loop while the client's connected
if (client.available()) { // if there's bytes to read from the client,
char c = client.read(); // read a byte, then
client.write(c);
Serial.write(c); // print it out the serial monitor
if (c == '\n') { // if the byte is a newline character
currentLine = "";
}
else {
currentLine += c; // add it to the end of the currentLine
}
}
}
// close the connection:
client.stop();
Serial.println("Command Client Disconnected.");
}
}
}
loopTask_ Blink()function will control the blinking of LED. When you see LED blinking, it indicates that ESP32-
S3 has been configured and starts working.
void loopTask_Blink(void *pvParameters) {
Serial.println("Task Blink is starting ... ");
while (1) {
digitalWrite(LED_BUILT_IN, !digitalRead(LED_BUILT_IN));
delay(1000);
}
}