Keyestudio ESP32 Manual page 153

Smart robot arm kit
Hide thumbs Also See for ESP32:
Table of Contents

Advertisement

return;
}
Serial.println("New
while
(!client.available()) {
the request and the data is available. While waiting, the code is delayed at
millisecond intervals
delay(1);
}
// HTML Page
//A string defines a simple HTML page that contains a title "Hello World!"
String webPage
=
"<html><head><title></title></head><body>";
webPage
+=
"<h1>Hello
webPage
+=
"</body></html>";
client.println("HTTP/1.1 200
indicate that the server successfully processed the request
client.println("Content-Type:
HTML
client.println("Connection:
response is finished
client.println();
response header and to begin the body content
client.println(webPage);
the client, so that the client will receive a message containing "Hello World!" as
response
delay(100);
// Add a delay to ensure that the response is fully sent
client.stop();
// Disconnect to client
}
After uploading code, the serial monitor displays ESP32 IP address. Search "http://[ESP32 IP address]" and
visit it in browser, and you will see the web page showing "Hello, World!".
When PC, mobile device and ESP32 board connect to the same network, you can visit that page on two devices
simultaneously. Here will be your IP address of ESP32.
PC:
Mobile:
9.4. 9.4 WiFi Control Robot Arm
client");
World!</h1>";
OK");
text/html");
close");
//The loop will wait until the client has
//Sends an HTTP response header
//Set the type of the response content
//Disconnect to the client when
//Send a blank line to end the
//Send the defined HTML page content
keyestudio WiKi
(continued from previous page)
sent␣
1␣
to␣
to␣
the␣
HTTP␣
to␣
a␣
149

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ESP32 and is the answer not in the manual?

Questions and answers

Related Products for Keyestudio ESP32

Table of Contents