https://doc.itprojects.cn/0006.zhishi.esp32/01.download/esp32_Schematic%20Prints.pdf
https://doc.itprojects.cn/0006.zhishi.esp32/01.download/esp_wroom_32_datasheet_cn.pdf
import machine
import time
pin2 = machine.Pin(2, machine.Pin.OUT)
while True:
pin2.value(1)
time.sleep(1)
pin2.value(0)
time.sleep(1)
import time
led2 = PWM(Pin(2))
led2.freq(1000)
while True:
for i in range(0, 1024):
led2.duty(i)
time.sleep_ms(1)
for i in range(1023, -1, -1):
led2.duty(i)
time.sleep_ms(1)
本次实验使用的灯为开发板上的灯,无需外接。