先敲个help(),ESP32里面到底有哪些,help一下:
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')
看看还有哪些模块,help('modules')

今天生病了,时间不够,那么就完善一下当前的连接wifi的代码
拉闸,好像mircopython对字符串不太友好,并不想python那么自如。
明天用正则表达式试一下
博客介绍了在ESP32上使用MicroPython的相关操作,包括通过help命令查看信息、使用machine模块访问硬件、进行基本WiFi配置等,还提及MicroPython对字符串处理不如Python自如,后续打算用正则表达式完善连接WiFi代码。
2890

被折叠的 条评论
为什么被折叠?



