Use D7 as a GPIO output on ESP32C3

I want to use the D7 pin (RX) as a GPIO output. How do I disconnect it from the UART function.

Solved:
Had to use the GPIO number 20, rather than D7 in the definitions and controls.

Would like to understand why if anyone cares to reply as I find the An/Dn vs GPIOn definition use seems to be somewhat random.

it is random… based on the chip manufacturer and chip version chip pins v/s board pins… but yes very confusing

also has to do with the code, which sometimes abreviates or creates variables or alias which does background conversion

1 Like

This same trick works on the xiao esp32S3, but with gpio 43/44.

just for everyone watching… this is what PJ calls BSP Board Support Package… this is the configuration files that make the connection between D7-GPIO20

so it is not technically a variable… it is a define… but basicly the BSP makes the
logical connection between the Chip pin and the board pin automaticly for you in the code
for a ESP32S3 D7 is on GPIO44

But on the ESP32C3 the BSP automaticly sets D7 to GPIO20

this is so theoredically the same code can run on an S3 or a C3 IF YOU SELECT the correct BSP at compile time

So the take away is to never turst a computer you cant throw out of a window
and know that many things are going on in the background, which intend to crash your program

Gremlins are REAL

so the take away is if you use the BSP for XIAO ESP23C3 assuming it is close enough to ESP32S3 Dev Kit for government work and dont want to waste the time loading more BSP… your program will NEVER WORK

HTH also a PJ abreviation for Hope That Helps