如果购买的是创客版或者其他的开发板,需要对esp32进行初始化(可以使用mixly工具进行)
项目使用了 635578 字节,占用了 (48%) 程序存储空间。最大为 1310720 字节。 全局变量使用了37908字节,(11%)的动态内存,余留289772字节局部变量。最大为327680字节。 esptool.py v3.0-dev Serial port COM4 Connecting… Chip is ESP32-D0WDQ6 (revision 1) Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None Crystal is 40MHz MAC: 08:3a:f2:8d:44:40 Uploading stub… Running stub… Stub running… Changing baud rate to 921600 Changed. Configuring flash size… Auto-detected Flash size: 4MB Compressed 8192 bytes to 47… Writing at 0x0000e000… (100 %) Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.0 seconds (effective 8192.1 kbit/s)… Hash of data verified. Compressed 18656 bytes to 12053… Writing at 0x00001000… (100 %) Wrote 18656 bytes (12053 compressed) at 0x00001000 in 0.2 seconds (effective 950.6 kbit/s)… Hash of data verified. Compressed 635696 bytes to 389215… Writing at 0x00010000… (4 %) Writing at 0x00014000… (8 %) Writing at 0x00018000… (12 %) Writing at 0x0001c000… (16 %) Writing at 0x00020000… (20 %) Writing at 0x00024000… (25 %) Writing at 0x00028000… (29 %) Writing at 0x0002c000… (33 %) Writing at 0x00030000… (37 %) Writing at 0x00034000… (41 %) Writing at 0x00038000… (45 %) Writing at 0x0003c000… (50 %) Writing at 0x00040000… (54 %) Writing at 0x00044000… (58 %) Writing at 0x00048000… (62 %) Writing at 0x0004c000… (66 %) Writing at 0x00050000… (70 %) Writing at 0x00054000… (75 %) Writing at 0x00058000… (79 %) Writing at 0x0005c000… (83 %) Writing at 0x00060000… (87 %) Writing at 0x00064000… (91 %) Writing at 0x00068000… (95 %) Writing at 0x0006c000… (100 %) Wrote 635696 bytes (389215 compressed) at 0x00010000 in 6.3 seconds (effective 809.0 kbit/s)… Hash of data verified. Compressed 3072 bytes to 128… Writing at 0x00008000… (100 %) Wrote 3072 bytes (128 compressed) at 0x00008000 in 0.0 seconds (effective 4915.3 kbit/s)… Hash of data verified.
Leaving… Hard resetting via RTS pin…
#include <WiFi.h> const char* id=“MERCURY_7FE080”; //定义两个字符串指针常量 const char* psw=“honeymqj1984”; void setup() { // put your setup code here, to run once: Serial.begin(9600); WiFi.begin(id,psw); while(WiFi.status()!=WL_CONNECTED){ //未连接上 delay(500); Serial.println(“正在连接…”); } Serial.println(“连接成功!”); //连接上 }
void loop() { // put your main code here, to run repeatedly: Serial.println(WiFi.status()); delay(1000); }
|