Then a small current flows, which may well cause the LED to glow. Unfortunately, you have not included any initialisation code, but I suspect that one of the internal pull resistors is switched on or that current is flowing externally. What does your hardware look like around the LED?
Regards
/Peter
In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
And what about the hardware, i.e. the schematics around the LED?
How is it connected to the voltage?
In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
WHAT??????? That is nonsense. The pin is defined as out push-pull output. It will drive high or drive low. Enabling the internal pull up or pull down will only draw more current.