esp8266 wifi library code example
Example 1: esp8266 wifi example
client.println("<style>html { font-family: Helvetica; display: inline-block; margin: 0px auto; text-align: center;}");
Example 2: esp8266 wifi example
// Connect to Wi-Fi network with SSID and password
Serial.print("Connecting to ");
Serial.println(ssid);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
// Print local IP address and start web server
Serial.println("");
Serial.println("WiFi connected.");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
server.begin();
Example 3: esp8266 wifi example
client.println("<link rel=\"icon\" href=\"data:,\">");
Example 4: esp8266 wifi example
client.println(".button2 {background-color: #77878A;}</style></head>");
Example 5: esp8266 wifi example
client.println("<p>GPIO 5 - State " + output5State + "</p>");
Example 6: esp8266 wifi example
// Assign output variables to GPIO pins
const int output5 = 5;
const int output4 = 4;