'U.V. LIGHT BOX TIMER
' USING 18X
start:
pause 50
serout 4,t2400,(254,1,12)
pause 100
main:
serout 4,t2400,(254,128," U.V. LIGHT BOX ")
serout 4,t2400,(254,192," EXPOSURE TIMER ")
look_again:
if pin0=0 then look_again
display:
b5=1
serout 4,t2400,(254,128," SET EXP TIME ")
serout 4,t2400,(254,192," in seconds ")
if pin0=0 then test
goto display
display1:
b5=2
serout 4,t2400,(254,128," DECREASE TIME ")
if pin0=0 then test
goto display1
display2:
b5=3
serout 4,t2400,(254,128," START ")
serout 4,t2400,(254,192," COUNTDOWN ")
if pin0=0 then test
goto display2
test:
pause 5
branch b5,(main,set_time,dec_time,countdown_to_10)
goto test
set_time:
if pin1=0 then goto inc_1
serout 4,t2400,(254,128," SET EXP TIME ")
serout 4,t2400,(254,192," ",#w1," seconds ")
let b0=20
w1=w1+b0
serout 4,t2400,(254,192," ",#w1," seconds ")
pause 5
release_up_button:
b5=0
for b5=b5 to 250
if pin1=0 then goto inc_1
if b5=250 then gosub cont_up
next b5
pause 2
if pin1=1 then goto release_up_button
pause 5
goto inc_1
cont_up:
let b0=20
w1=w1+b0
serout 4,t2400,(254,192," ",#w1," seconds ")
pause 200
if pin1=1 then cont_up
return
inc_1:
if pin1=1 then set_time
pause 5
if pin0=1 then display1
goto inc_1
dec_time:
if w1<10 then main
if pin1=0 then goto inc_2
serout 4,t2400,(254,128," DECREASE TIME ")
let b0=10
w1=w1-b0 min 10
serout 4,t2400,(254,192," ",#w1," seconds ")
pause 5
release_down_button:
b5=0
for b5=b5 to 250
if pin1=0 then goto inc_2
if b5=250 then gosub cont_down
next b5
pause 2
if pin1=1 then goto release_down_button
serout 4,t2400,(254,128," DECREASE TIME ")
pause 5
goto inc_2
cont_down:
let b0=10
w1=w1-b0
serout 4,t2400,(254,192," ",#w1," seconds ")
pause 200
if pin1=1 then cont_down
return
inc_2:
if pin1=1 then dec_time
pause 5
if pin0=1 then display2
goto inc_2
countdown_to_10:
if pin0=1 then display
if pin1=0 then countdown_to_10
high 7
setint %00000001,%00000001
serout 4,t2400,(254,128," U.V. lights ")
serout 4,t2400,(254,192," powering up ")
pause 2000
serout 4,t2400,(254,128," TIME REMAINING ")
for w1=w1 to 10 step-1
serout 4,t2400,(254,192," ",#w1," seconds ")
if w1<10 then goto countdown_to_0
pause 765
serout 4,t2400,(254,192," ",#w1)
sound 6,(100,6)
low 6
next w1
countdown_to_0:
serout 4,t2400,(254,128," TIME REMAINING ")
if w1=0 then goto display
for w1=w1 to 0 step-1
serout 4,t2400,(254,195,"0",#w1," seconds ")
pause 765
serout 4,t2400,(254,195,"0",#w1)
sound 6,(100,6)
low 6
if w1=0 then goto finish
next w1
interrupt:
low 7
serout 4,t2400,(254,128,"SYSTEM PAUSED AT")
serout 4,t2400,(254,192," < ",#w1," seconds ")
if pin0=1 then interrupt
gosub resume
setint %00000001,%00000001
serout 4,t2400,(254,128," RESUME SYSTEM ")
serout 4,t2400,(254,192," COUNTDOWN ")
pause 2000
high 7
serout 4,t2400,(254,128," U.V. lights ")
serout 4,t2400,(254,192," powering up ")
pause 2000
serout 4,t2400,(254,128," TIME REMAINING ")
serout 4,t2400,(254,192," ",#w1," seconds ")
return
resume:
if pin1=0 then resume
pause 5
return
finish:
low 7
setint 0,0
sound 6,(100,150)
pause 990
goto final
final:
serout 4,t2400,(254,128," exposure time ")
serout 4,t2400,(254,192," completed! ")
pause 900
check:
if pin1=1 then main
goto check