symbol light = w1 input 0 input 1 start: pause 1000 readadc10 1,light if light > 100 then wakeup pause 1000 readadc10 1,light if light < 100 then gosleep wakeup: high 4 pause 200 low 4 random w0 pause w0 random w0 pause w0 goto start gosleep: pause 2000 readadc10 1,light if light < 100 then gosleep goto start end