1、用安卓数据线连接上esp32
2、main.cpp 代码如下
#include <Arduino.h> #include <WiFi.h> void WiFi_Connect(){ WiFi.begin("erdao_pinpai_2.4","erdao123456");//连接wifi,第一个参数wifi名字,第二个参数wifi密码 while (WiFi.status() != WL_CONNECTED) { delay(300);//暂停300毫秒 Serial.print("."); } } void setup() { //初始化 // put your setup code here, to run once: //pinMode(0,OUTPUT); Serial.begin(115200); //设置串联波特率 delay(100); Serial.print("Connecting..."); WiFi_Connect();//调用连接wifi Serial.print("WIFI Connected..."); Serial.print("IP address:"); Serial.print(WiFi.localIP()); //打印出ip地址 } void loop() { // put your main code here, to run repeatedly: }
3、可以下载一个XCOM V2.0看效果
标签:WiFi,Esp32,wifi,void,print,Serial,连接 From: https://www.cnblogs.com/guoxiaobin668/p/17150572.html