I want to connect a LDR into the GPIO pins of my Raspberry Pi, I know that Raspberry Pi doesn't have an analog-to-digital converter so what I want to do is to signal a HIGH signal (3.3v) on the GPIO when there is low resistance on the LDR (something below 200 ohms) and a LOW signal when the resistance of the LDR is high (above 2k for instance). The maximum current that I can safely drawn from the GPIO pins of the Raspberry Pi, according to the documentation is 50mA, how do I calculate the resistor needed, will I need to add a pull up/down resistor too ? I don't have a clear idea on how to do that on a safe way without burning my processor.
I imagine that I also have to plug a resistor on the circuit to make sure that it always has a resistance when the LDR is on a very low resistance state.
Update: it worked fine, I built the circuit and it is shown in this post, thanks for the help.