@Mathijs I just connected the LDR, but i don’t get a usable signal from it. It just displays me 4095 as the input signal, so the highest value i suppose. Covering the LDR doesn’t change anything. I attached a photo of my setup and my code. I changed the cables, the resistor, the ground connection and even the LDR.
If i deattach the 3.3V the Value drops to 0 as it should. Do you have any idea where the problem might be?
Edit: if i rebuild the Setup with my Arduino Mega, then it works, guess there is something wrong with my ESP32 right?
Edit nevermind, you already tried. Really strange behavior indeed.
Are you sure the breadboard connection is working properly? Do you measure 3.3V with a multimeter?
Also you can use some other pins to try and read out the value. Does it work on other pins?