Im trying to set RA4 to +5V output and wait a short time for the capacitor to discharge (both plates at +5V). Then, change the pin to act as an input. As soon as this is done the capacitor will be free to charge up again through the resistor (Ie it brings the capacitor plate back down to 0 Volts). As soon as the pin is changed to an input, it suppose that i have to wait for a certain amount of time and if it hasn't charged by then assume that the resistance is high and therefore the light levels are low.
(I use 10K parallel with capacitor of 100nF)
The problem is that i can't get 5V out from RA4 of 16F877!!!.. so i can't charge and discharge the capacitor
Any ideas how to fix the problem??
thanks