photo resitor
wiresalot
Posts: 40
Hello.
How do I use the photo resistor like a dusk till dawn photo cell? Either ON or OFF in the code?
Thanks.
wiresalot
How do I use the photo resistor like a dusk till dawn photo cell? Either ON or OFF in the code?
Thanks.
wiresalot
Comments
www.parallax.com/tabid/440/Default.aspx
Thanks
wiresalot
wiresalot
' {$STAMP BS2}
' {$PBASIC 2.5}
value VAR Word
Main:
DO
HIGH 2
PAUSE 100
RCTIME 2, 1, value ' measure rctime
DEBUG DEC value, CR
IF (value > 400 ) THEN ' evaluate duration
DEBUG "Value was greater than 400 " : HIGH 15
ELSEIF (value = 4000) THEN
DEBUG "Value was equal to 400"
ELSE
DEBUG "Value was less than 400 " : LOW 15
ENDIF
DEBUG CR, CR
PAUSE 1000
LOOP
Does my programing look ok?
Thanks
wiresalot
do you want (value = 4000) in the elseif statement?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
If you convince yourself that something is impossible before you even try; you are sure to prove yourself right.
Thanks
wiresalot