资讯动态

【ESP32学习笔记】软件学习及操作方法

发布时间:2026/9/11 2:09:50 来源:尧图企业网站定制
1. 开发板的认识这里不用管D开头只要关注后面的数字是多少就是多少号引脚。2. 外设介绍1.数码管多位数码管2.LEDC输出PWM信号使用LEDC控制舵机:3.ADC4.IIC5.SPI6.外部中断7.硬件定时器8.WIFI模块参考例程:连接热点WIFI代码这里不能连接需要网页验证的WIFI#includeWiFi.hconstchar*ssidAnswer1st;// Change this to your WiFi SSIDconstchar*passwordliugeliu;// Change this to your WiFi password#defineLED2voidsetup(){Serial.begin(115200);while(!Serial){delay(100);}// We start by connecting to a WiFi networkSerial.println();Serial.println(******************************************************);Serial.print(Connecting to );Serial.println(ssid);WiFi.begin(ssid,password);while(WiFi.status()!WL_CONNECTED){delay(500);Serial.print(.);}Serial.println();Serial.println(WiFi connected);Serial.println(IP address: );Serial.println(WiFi.localIP());pinMode(LED,OUTPUT);digitalWrite(LED,HIGH);}voidloop(){}ESP32创建热点#includeWiFi.h#includeWiFiClient.h#includeWiFiAP.h#defineLED_BUILTIN2// 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.constchar*ssidESP32;constchar*password1213121212;WiFiServerserver(80);voidsetup(){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.// a valid password must have more than 7 charactersif(!WiFi.softAP(ssid,password)){log_e(Soft AP creation failed.);while(1);}IPAddress myIPWiFi.softAPIP();Serial.print(AP IP address: );Serial.println(myIP);server.begin();Serial.println(Server started);}voidloop(){}9.SD卡3.ESP强大的物联网功能1.开启一个MQTT服务2. 创建一个产品3.基于ESP32 MQTT 连接Onenet云端并在云端添加设备详情4.生成AT指令参考填写5.生成云端连接需要的Token4. 使用Platformio开发ESP321. 此处下载库文件2. 进行如下的设置3.这里是一个标准的文件结构4.下载库文件

读完文章,也想定制专属网站?

尧图设计师 24 小时内与您沟通定制方案

免费获取报价