ESP32:如何将 GPIO12 配置为输出
默认情况下,ESP32 上的 GPIO12 被配置为 MTDI(JTAG)引脚。
要将其用作常规 GPIO 输出引脚,需要在代码中显式地将其功能设置为 GPIO 模式:
esp32_gpio12_output_setup.cpp
#include <soc/gpio_periph.h>
#include <soc/io_mux_reg.h>
// 在将 GPIO12 用作输出之前运行一次
PIN_FUNC_SELECT(GPIO_PIN_MUX_REG[GPIO_NUM_12], PIN_FUNC_GPIO);Check out similar posts by category:
ESP8266/ESP32, Embedded, Electronics
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow