@robert-hh said in Use photocell with GPIO: me could be longer, and must not be not shorter, since it discharges the capacitor. The sample code talks about a loop time of 1 ms. WiPy is faster. The loop time should be around 15 µs. Are you sure that you connected the photocell between 3.3v and P10? If you never have a '1' reading at P10 as input, then the wiring is wrong. I mad a quick crosscheck with G9 = P22, and sleep(0.1), and it worked. Nevertheless, you could do better using the analog ports of the esp32 with a resistor and the photocell. Hello, I just tried again and it is working now. Thanks