插上开发板后查看,在设备管理器中查看端口(Windows+R 输入devmgmt.msc),如果未识别需要下载安装驱动,记住这里的端口号(如:COM3).
打开命令行依次执行
(1) 安装esptool 输入:
pip install esptool
esptool.py --port COM3 erase_flash
esptool.py --port COM3 --baud 115200 write_flash -z 0x1000 C:\esp32-20171102-v1.9.2-443-g236297f4.bin --verify
Welcome to MicroPython on the ESP32!
For generic online docs please visit http://docs.micropython.org/
For access to the hardware use the 'machine' module:
import machine
pin12 = machine.Pin(12, machine.Pin.OUT)
pin12.value(1)
pin13 = machine.Pin(13, machine.Pin.IN, machine.Pin.PULL_UP)
print(pin13.value())
i2c = machine.I2C(scl=machine.Pin(21), sda=machine.Pin(22))
i2c.scan()
i2c.writeto(addr, b'1234')
i2c.readfrom(addr, 4)
Basic WiFi configuration:
import network
sta_if = network.WLAN(network.STA_IF); sta_if.active(True)
sta_if.scan() # Scan for available access points
sta_if.connect("<AP_name>", "<password>") # Connect to an AP
sta_if.isconnected() # Check for successful connection
Control commands:
CTRL-A -- on a blank line, enter raw REPL mode
CTRL-B -- on a blank line, enter normal REPL mode
CTRL-C -- interrupt a running program
CTRL-D -- on a blank line, do a soft reset of the board
CTRL-E -- on a blank line, enter paste mode
For further help on a specific object, type help(obj)
For a list of available modules, type help('modules')
For further help on a specific object, type help(obj)
For a list of available modules, type help('modules')
help('modules')
main framebuf re upip
_boot gc select upip_utarfile
_onewire hashlib socket upysh
_thread heapq ssl urandom
apa106 inisetup struct ure
array io sys urequests
binascii json time uselect
btree machine ubinascii usocket
builtins math ucollections ussl
cmath micropython uctypes ustruct
collections neopixel uerrno utime
dht network uhashlib utimeq
ds18x20 ntptime uheapq uzlib
errno onewire uio zlib
esp os ujson
flashbdev random uos
Plus any modules on the filesystem
help(network)
object <module 'network'> is of type module
name -- network
init -- <function>
WLAN -- <function>
LAN -- <function>
phy_mode -- <function>
STA_IF -- 0
AP_IF -- 1
MODE_11B -- 1
MODE_11G -- 2
MODE_11N -- 4
AUTH_OPEN -- 0
AUTH_WEP -- 1
AUTH_WPA_PSK -- 2
AUTH_WPA2_PSK -- 3
AUTH_WPA_WPA2_PSK -- 4
AUTH_MAX -- 6
PHY_LAN8720 -- 0
PHY_TLK110 -- 1
四位数码管是一种常见的LED显示器件,主要用于显示数字信息。
本程序是小鹏物联网智能浇花套件的单机版程序(不连接物联网),供同学们参考。
本文介绍ESP32中的中断机制,以及如何通过GPIO中断实现按钮控制。重点讲解了如何设置中断服务例程、处理中断抖动问题,并提供了消除中断抖动的示例代码。
本文主要介绍在未联网(AP热点)情况下实现WEB交互界面的CSS和javascript库。
本文介绍如何使用Arduino-ESP32库中的API函数获取ESP32的芯片、RAM信息等,并提供了一个示例程序代码。
ESP32系列(包括ESP32-S3)搭载Xtensa双核处理器,默认情况下Arduino框架仅使用单核运行用户代码,通过多核编程,可以充分利用硬件资源来提升系统响应和性能。
ESP32 芯片有34个物理GPIO管脚。每个GPIO管脚都可用作一个通用IO,或连接一个内部的外设信号。IO_MUX ¹、RTC IO MUX 和GPIO交换矩阵用于将信号从外设传输至GPIO管脚。
ESP32Encoder库是一个利用ESP32脉冲计数器硬件外设实现高效旋转编码器读取的软件库。
本文对比了几款适合物联网开发的盒子硬件参数,供大家参考。
乐动掌控采用掌控板作为主控,塑胶一体式外壳,侧面和底面开具多个乐高扩展孔位,兼容乐高积木,可完成多种创意应用。
在MicroPython的ESP32库中,NVS类用于管理非易失性存储,支持 32 位有符号整数和 二进制blob。