webserver 例程
学生复制粘贴
// Load Wi-Fi library
#include <ESP8266WiFi.h>
// Replace with your network credentials
//const char* ssid = "Marstyle";
//const char* password = "HHXXTTXS";
const char* ssid = "SJT";
const char* password = "13931105775QWER";
// Set web server port number to 80
WiFiServer server(80);
// Variable to store the HTTP request
String header;
// Auxiliar variables to store the current output state
String output5State = "off";
String output4State = "off";
// Assign output variables to GPIO pins
const int output5 = 5;
const int output4 = D4;
void setup() {
Serial.begin(115200);
// Initialize the output variables as outputs