Hello,
I wrote the simplified code below so that one of four light displays would appear randomly and it works perfectly in the simulation, but when I program my 28x PICAXE, it doesn't seem to work and only the collapse segment of the code continously loops. Where did I go horribly wrong?
thanks,
DD
I wrote the simplified code below so that one of four light displays would appear randomly and it works perfectly in the simulation, but when I program my 28x PICAXE, it doesn't seem to work and only the collapse segment of the code continously loops. Where did I go horribly wrong?
thanks,
DD
Code:
main:
random w0
if w0 > 30000 then random1
if w0 < 30000 then random2
goto main
random1:
random w1
if w1 > 30000 then chain
if w2 < 30000 then alternating
goto main
random2:
let w2 = timer
random w2
if w2 > 30000 then wash
if w2 < 30000 then collapse
goto main
collapse:
high 4
wait 2
low 4
goto main
wash:
high 1
wait 2
low 1
goto main
chain:
high 7
wait 2
low 7
goto main
alternating:
high 0
wait 2
low 0
goto main