I want to use pin 2 not for built in led nodemcu ESP32s

I want to use pin 2 not for built in led nodemcu ESP32s. I have a MOSFET connected to pin 2 (cannot change it) and I wanna use it, but everytime I want to use it, built in led does it instead.
Pls help
Maciek

If you have a MOSFET connected to pin 2 there should be no issue, just don't use LED_BUILTIN in your code. Since the built int LED is active 'LOW' (and is pulled HIGH), you will have to specifically set pin 2 to 'OUTPUT' and 'LOW' (which will make the LED light up) or the positive voltage that is applied to the LED (via a resistor) will open the MOSFET up. At boot pin 2 is in INPUT state, so the MOSFET will open. If this is a problem, you should remove either the LED or the resistor (the LED is easier to find.) with the use of a soldering iron.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.