ESP32: How to configure GPIO12 as output
By default, GPIO12 on the ESP32 is configured as MTDI (JTAG) pin.
In order to use it as a regular GPIO output pin, you need to explicitly set its function to GPIO mode in your code:
esp32_gpio12_output_setup.cpp
#include <soc/gpio_periph.h>
#include <soc/io_mux_reg.h>
// Run this once before using GPIO12 as output
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