I know this does not answer your questions, but have you looked into using an ADC for this?
The photo resistor rigged as half a voltage divider. At an eight bit resolution the ADC will give 0 to 255 as an output.
Then if the ADC var is 128 your code would say
The ADC is more predictable than the RCTIME.Code:IF ADCVAR = 128 then ???
RCTIME is dependent on the OSC , cap and resistance.
The output will either be calculated or in your case measured at full light and no light.
Once you have these values,
Hope this helps.Code:IF tone = x? then ???





Bookmarks