I'm wanting to do something according to how much light is seen by an LDR. I wrote this to check the light, and it seems to work fine whether or not I use the pauses. The LDR is on pin 1 and the power for it comes from pin 0 when I put it high. I want this low power, so after I check the light, I turn pin 0 back off and put pin 1 back to an output and put it low. I used Dippy's trick after that, and turn off the ADC converter. I'm happy my meter shows only 1.8ua while sleeping, and I'll be changing that to a longer sleep...I just wonder if the pauses are needed here ???
main:
input 1
'pause 100
high 0
'pause 100
readadc 1,b1
'pause 100
low 0
low 1
POKE $1F,0
if b1 > 200 and b2 = 0 then night_time
if b1 < 200 and b2 = 1 then day_time
sleep 1
goto main
main:
input 1
'pause 100
high 0
'pause 100
readadc 1,b1
'pause 100
low 0
low 1
POKE $1F,0
if b1 > 200 and b2 = 0 then night_time
if b1 < 200 and b2 = 1 then day_time
sleep 1
goto main