toggle between 2 sensors i want to read from

robtillaart:
Instead of 5V you could connect the LDR and the potmeter to a digital pin. If the pin is set HIGH the appropiate device gets 5V. With an inverter you need only 1 pin.

What's the problem with using the 5V?