|
简易代码
- #include <ESP8266WiFi.h>
- const char *ssid = "xiefandaren"; // 设置WIFI的名称
- const char *password = "12345678"; // 设置WIFI的密码
- void setup() {
- Serial.begin(115200);
- Serial.println();
- // START 设置自己的WIFI wifi名称+密码+IP
- Serial.print("Setting soft-AP ... ");
- IPAddress softLocal(192, 168, 128, 1);
- IPAddress softGateway(192, 168, 128, 1);
- IPAddress softSubnet(255, 255, 255, 0);
- WiFi.softAPConfig(softLocal, softGateway, softSubnet);
- WiFi.softAP(ssid, password);
- Serial.print("AP IP address: ");
-
- Serial.println(WiFi.softAPIP());
- // END 设置自己的WIFI wifi名称+密码+IP
- }
- void loop() {}
复制代码
|
|