William Elwell
New Member
In one of the posts here there is an electric candle. I don't understand the fourth line in the code below. What does [if light < 60 then led] do? What is < 60?
[
init:
b2 = 200
symbol light = b3
main:
readadc 1,light
'debug light
if light < 60 then led
pwmout 2,0,0
nap 5
goto main
led:
random w0
if b0 < 130 then default
pause 150
pwmout 2,b0,b2
if b1 < 130 then default
pause 150
pwmout 2,b1,b2
readadc 1,light
'debug light
if light > 90 then main
goto led
default:
pause 150
pwmout 2,180,b2
pause 150
pwmout 2,220,b2
readadc 1,light
'debug light
if light > 90 then main
goto led
]
[
init:
b2 = 200
symbol light = b3
main:
readadc 1,light
'debug light
if light < 60 then led
pwmout 2,0,0
nap 5
goto main
led:
random w0
if b0 < 130 then default
pause 150
pwmout 2,b0,b2
if b1 < 130 then default
pause 150
pwmout 2,b1,b2
readadc 1,light
'debug light
if light > 90 then main
goto led
default:
pause 150
pwmout 2,180,b2
pause 150
pwmout 2,220,b2
readadc 1,light
'debug light
if light > 90 then main
goto led
]