Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/arduino/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Arduino 退出状态1';类WiFiClass';没有名为“的成员”;softAP“;在诺登姆库 #包括 #包括 #定义LED_BUILTIN 2//设置连接测试LED的GPIO引脚,如果开发板上有内置LED,则注释掉这一行 //将这些设置为所需的凭据。 const char*ssid=“OptimusCrime”; const char*password=“01679044306”; WiFiServer服务器(80); 无效设置(){ 引脚模式(LED内置,输出); 序列号开始(115200); Serial.println(); Serial.println(“配置接入点…”); //如果要打开AP,可以删除密码参数。 WiFi.softAP(ssid,密码); IPAddress myIP=WiFi.softAPIP(); 串行打印(“AP IP地址:”); 序列号println(myIP); server.begin(); Serial.println(“服务器已启动”); } void循环(){ WiFiClient client=server.available();//侦听传入的客户端 如果(客户){//如果你有客户, Serial.println(“新客户机”);//从串行端口打印消息 String currentLine=“;//生成一个字符串以保存来自客户端的传入数据 while(client.connected()){//在连接客户端时循环 如果(client.available()){//如果要从客户端读取字节, char c=client.read();//读取一个字节,然后 Serial.write(c);//在串行监视器上打印出来 如果(c=='\n'){//如果字节是换行符 //如果当前行为空,则一行中有两个换行符。 //客户端HTTP请求到此结束,请发送响应: 如果(currentLine.length()==0){ //HTTP标头始终以响应代码开头(例如HTTP/1.1 200 OK) //和一个内容类型,以便客户端知道接下来会发生什么,然后是一个空行: client.println(“HTTP/1.1200ok”); client.println(“内容类型:text/html”); client.println(); //HTTP响应的内容如下所示: 客户端。打印(“单击以打开LED.”; 打印(“单击以关闭LED.”; //HTTP响应以另一个空行结束: client.println(); //打破while循环: 打破 }否则{//如果有换行符,请清除currentLine: currentLine=“”; } }else如果(c!='\r'){//如果您得到的不是回车字符,而是其他字符, currentLine+=c;//将其添加到currentLine的末尾 } //检查客户端请求是“GET/H”还是“GET/L”: if(currentLine.endsWith(“GET/H”)){ digitalWrite(LED_内置,高);//GET/H打开LED } if(currentLine.endsWith(“GET/L”)){ digitalWrite(LED_内置,低);//GET/L关闭LED } } } //关闭连接: client.stop(); Serial.println(“客户端断开连接”); } }_Arduino_Wifi_Esp8266_Nodemcu - Fatal编程技术网

Arduino 退出状态1';类WiFiClass';没有名为“的成员”;softAP“;在诺登姆库 #包括 #包括 #定义LED_BUILTIN 2//设置连接测试LED的GPIO引脚,如果开发板上有内置LED,则注释掉这一行 //将这些设置为所需的凭据。 const char*ssid=“OptimusCrime”; const char*password=“01679044306”; WiFiServer服务器(80); 无效设置(){ 引脚模式(LED内置,输出); 序列号开始(115200); Serial.println(); Serial.println(“配置接入点…”); //如果要打开AP,可以删除密码参数。 WiFi.softAP(ssid,密码); IPAddress myIP=WiFi.softAPIP(); 串行打印(“AP IP地址:”); 序列号println(myIP); server.begin(); Serial.println(“服务器已启动”); } void循环(){ WiFiClient client=server.available();//侦听传入的客户端 如果(客户){//如果你有客户, Serial.println(“新客户机”);//从串行端口打印消息 String currentLine=“;//生成一个字符串以保存来自客户端的传入数据 while(client.connected()){//在连接客户端时循环 如果(client.available()){//如果要从客户端读取字节, char c=client.read();//读取一个字节,然后 Serial.write(c);//在串行监视器上打印出来 如果(c=='\n'){//如果字节是换行符 //如果当前行为空,则一行中有两个换行符。 //客户端HTTP请求到此结束,请发送响应: 如果(currentLine.length()==0){ //HTTP标头始终以响应代码开头(例如HTTP/1.1 200 OK) //和一个内容类型,以便客户端知道接下来会发生什么,然后是一个空行: client.println(“HTTP/1.1200ok”); client.println(“内容类型:text/html”); client.println(); //HTTP响应的内容如下所示: 客户端。打印(“单击以打开LED.”; 打印(“单击以关闭LED.”; //HTTP响应以另一个空行结束: client.println(); //打破while循环: 打破 }否则{//如果有换行符,请清除currentLine: currentLine=“”; } }else如果(c!='\r'){//如果您得到的不是回车字符,而是其他字符, currentLine+=c;//将其添加到currentLine的末尾 } //检查客户端请求是“GET/H”还是“GET/L”: if(currentLine.endsWith(“GET/H”)){ digitalWrite(LED_内置,高);//GET/H打开LED } if(currentLine.endsWith(“GET/L”)){ digitalWrite(LED_内置,低);//GET/L关闭LED } } } //关闭连接: client.stop(); Serial.println(“客户端断开连接”); } }

Arduino 退出状态1';类WiFiClass';没有名为“的成员”;softAP“;在诺登姆库 #包括 #包括 #定义LED_BUILTIN 2//设置连接测试LED的GPIO引脚,如果开发板上有内置LED,则注释掉这一行 //将这些设置为所需的凭据。 const char*ssid=“OptimusCrime”; const char*password=“01679044306”; WiFiServer服务器(80); 无效设置(){ 引脚模式(LED内置,输出); 序列号开始(115200); Serial.println(); Serial.println(“配置接入点…”); //如果要打开AP,可以删除密码参数。 WiFi.softAP(ssid,密码); IPAddress myIP=WiFi.softAPIP(); 串行打印(“AP IP地址:”); 序列号println(myIP); server.begin(); Serial.println(“服务器已启动”); } void循环(){ WiFiClient client=server.available();//侦听传入的客户端 如果(客户){//如果你有客户, Serial.println(“新客户机”);//从串行端口打印消息 String currentLine=“;//生成一个字符串以保存来自客户端的传入数据 while(client.connected()){//在连接客户端时循环 如果(client.available()){//如果要从客户端读取字节, char c=client.read();//读取一个字节,然后 Serial.write(c);//在串行监视器上打印出来 如果(c=='\n'){//如果字节是换行符 //如果当前行为空,则一行中有两个换行符。 //客户端HTTP请求到此结束,请发送响应: 如果(currentLine.length()==0){ //HTTP标头始终以响应代码开头(例如HTTP/1.1 200 OK) //和一个内容类型,以便客户端知道接下来会发生什么,然后是一个空行: client.println(“HTTP/1.1200ok”); client.println(“内容类型:text/html”); client.println(); //HTTP响应的内容如下所示: 客户端。打印(“单击以打开LED.”; 打印(“单击以关闭LED.”; //HTTP响应以另一个空行结束: client.println(); //打破while循环: 打破 }否则{//如果有换行符,请清除currentLine: currentLine=“”; } }else如果(c!='\r'){//如果您得到的不是回车字符,而是其他字符, currentLine+=c;//将其添加到currentLine的末尾 } //检查客户端请求是“GET/H”还是“GET/L”: if(currentLine.endsWith(“GET/H”)){ digitalWrite(LED_内置,高);//GET/H打开LED } if(currentLine.endsWith(“GET/L”)){ digitalWrite(LED_内置,低);//GET/L关闭LED } } } //关闭连接: client.stop(); Serial.println(“客户端断开连接”); } },arduino,wifi,esp8266,nodemcu,Arduino,Wifi,Esp8266,Nodemcu,错误为(退出状态1“类WiFiClass”没有名为“softAP”的成员) 我不知道为什么只有我一个人会这样,请帮忙(一堆随机词,所以它没有说“看起来你的文章大部分是代码;请添加更多细节”:aifnalvanalinflajsfnlavnakninfef) 无论如何,感谢您按问题查看如果您是为ESP8266构建此文件,您使用的标题文件名不正确 #include <WiFi.h> #include <WiFiClient.h> #define LED_BUILTIN

错误为(退出状态1“类WiFiClass”没有名为“softAP”的成员) 我不知道为什么只有我一个人会这样,请帮忙(一堆随机词,所以它没有说“看起来你的文章大部分是代码;请添加更多细节”:aifnalvanalinflajsfnlavnakninfef)
无论如何,感谢您按问题查看

如果您是为ESP8266构建此文件,您使用的标题文件名不正确

#include <WiFi.h>
#include <WiFiClient.h>

 
#define LED_BUILTIN 2   // Set the GPIO pin where you connected your test LED or comment this line out if your dev board has a built-in LED
 
// Set these to your desired credentials.
const char *ssid = "OptimusCrime";
const char *password = "01679044306";
 
WiFiServer server(80);
 
 
void setup() {
  pinMode(LED_BUILTIN, OUTPUT);
 
  Serial.begin(115200);
  Serial.println();
  Serial.println("Configuring access point...");
 
  // You can remove the password parameter if you want the AP to be open.
  WiFi.softAP(ssid, password);
  IPAddress myIP = WiFi.softAPIP();
  Serial.print("AP IP address: ");
  Serial.println(myIP);
  server.begin();
 
  Serial.println("Server started");
}
 
void loop() {
  WiFiClient client = server.available();   // listen for incoming clients
 
  if (client) {                             // if you get a client,
    Serial.println("New 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
        Serial.write(c);                    // print it out the serial monitor
        if (c == '\n') {                    // if the byte is a newline character
 
          // if the current line is blank, you got two newline characters in a row.
          // that's the end of the client HTTP request, so send a response:
          if (currentLine.length() == 0) {
            // HTTP headers always start with a response code (e.g. HTTP/1.1 200 OK)
            // and a content-type so the client knows what's coming, then a blank line:
            client.println("HTTP/1.1 200 OK");
            client.println("Content-type:text/html");
            client.println();
 
            // the content of the HTTP response follows the header:
            client.print("Click <a href=\"/H\">here</a> to turn ON the LED.<br>");
            client.print("Click <a href=\"/L\">here</a> to turn OFF the LED.<br>");
 
            // The HTTP response ends with another blank line:
            client.println();
            // break out of the while loop:
            break;
          } else {    // if you got a newline, then clear currentLine:
            currentLine = "";
          }
        } else if (c != '\r') {  // if you got anything else but a carriage return character,
          currentLine += c;      // add it to the end of the currentLine
        }
 
        // Check to see if the client request was "GET /H" or "GET /L":
        if (currentLine.endsWith("GET /H")) {
          digitalWrite(LED_BUILTIN, HIGH);               // GET /H turns the LED on
        }
        if (currentLine.endsWith("GET /L")) {
          digitalWrite(LED_BUILTIN, LOW);                // GET /L turns the LED off
        }
      }
    }
    // close the connection:
    client.stop();
    Serial.println("Client Disconnected.");
  }
}
#包括
应该是

#include <WiFi.h>
#包括

将向您显示正确使用此ESP8266 wifi库的更多代码。

如果您为ESP8266构建此库,则使用的头文件名不正确

#include <WiFi.h>
#include <WiFiClient.h>

 
#define LED_BUILTIN 2   // Set the GPIO pin where you connected your test LED or comment this line out if your dev board has a built-in LED
 
// Set these to your desired credentials.
const char *ssid = "OptimusCrime";
const char *password = "01679044306";
 
WiFiServer server(80);
 
 
void setup() {
  pinMode(LED_BUILTIN, OUTPUT);
 
  Serial.begin(115200);
  Serial.println();
  Serial.println("Configuring access point...");
 
  // You can remove the password parameter if you want the AP to be open.
  WiFi.softAP(ssid, password);
  IPAddress myIP = WiFi.softAPIP();
  Serial.print("AP IP address: ");
  Serial.println(myIP);
  server.begin();
 
  Serial.println("Server started");
}
 
void loop() {
  WiFiClient client = server.available();   // listen for incoming clients
 
  if (client) {                             // if you get a client,
    Serial.println("New 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
        Serial.write(c);                    // print it out the serial monitor
        if (c == '\n') {                    // if the byte is a newline character
 
          // if the current line is blank, you got two newline characters in a row.
          // that's the end of the client HTTP request, so send a response:
          if (currentLine.length() == 0) {
            // HTTP headers always start with a response code (e.g. HTTP/1.1 200 OK)
            // and a content-type so the client knows what's coming, then a blank line:
            client.println("HTTP/1.1 200 OK");
            client.println("Content-type:text/html");
            client.println();
 
            // the content of the HTTP response follows the header:
            client.print("Click <a href=\"/H\">here</a> to turn ON the LED.<br>");
            client.print("Click <a href=\"/L\">here</a> to turn OFF the LED.<br>");
 
            // The HTTP response ends with another blank line:
            client.println();
            // break out of the while loop:
            break;
          } else {    // if you got a newline, then clear currentLine:
            currentLine = "";
          }
        } else if (c != '\r') {  // if you got anything else but a carriage return character,
          currentLine += c;      // add it to the end of the currentLine
        }
 
        // Check to see if the client request was "GET /H" or "GET /L":
        if (currentLine.endsWith("GET /H")) {
          digitalWrite(LED_BUILTIN, HIGH);               // GET /H turns the LED on
        }
        if (currentLine.endsWith("GET /L")) {
          digitalWrite(LED_BUILTIN, LOW);                // GET /L turns the LED off
        }
      }
    }
    // close the connection:
    client.stop();
    Serial.println("Client Disconnected.");
  }
}
#包括
应该是

#include <WiFi.h>
#包括
将向您显示正确使用此ESP8266 wifi库的更多代码。

\include
\include