Code:
Channel1:
pause 25 ; debounce
if sw1 = 0 then
if led1 = 0 or swstat = 1 then
if led1 = 0 then sound pz,[123,10]: high led1
pause 300
swstat = 1
l=l+1
if l => 5 then
for i = 1 to 11: toggle led1: sound pz,[123,10]: pause 50: next i
goto Bprog1
else
goto Channel1
endif
else
low led1: low tr1: sound pz,[123,10]
pause 100
while sw1 = 0: wend
endif
endif
swstat = 0
goto main
Channel2:
pause 25 ; debounce
if sw2 = 0 then
if led2 = 0 or swstat = 1 then
if led2 = 0 then sound pz,[123,10]: high led2
pause 300
swstat = 1
l=l+1
if l => 5 then
for i = 1 to 11: toggle led2: sound pz,[123,10]: pause 50: next i
goto Bprog2
else
goto Channel2
endif
else
low led2: low tr2: sound pz,[123,10]
pause 100
while sw2 = 0: wend
endif
endif
swstat = 0
goto main
Channel3:
pause 25 ; debounce
if sw3 = 0 then
if led3 = 0 or swstat = 1 then
if led3 = 0 then sound pz,[123,10]: high led3
pause 300
swstat = 1
l=l+1
if l => 5 then
for i = 1 to 11: toggle led3: sound pz,[123,10]: pause 50: next i
goto Bprog3
else
goto Channel3
endif
else
low led3: low tr3: sound pz,[123,10]
pause 100
while sw3 = 0: wend
endif
endif
swstat = 0
goto main
Channel4:
pause 25 ; debounce
if sw4 = 0 then
if led4 = 0 or swstat = 1 then
if led4 = 0 then sound pz,[123,10]: high led4
pause 300
swstat = 1
l=l+1
if l => 5 then
for i = 1 to 11: toggle led4: sound pz,[123,10]: pause 50: next i
goto Bprog4
else
goto Channel4
endif
else
low led4: low tr4: sound pz,[123,10]
pause 100
while sw4 = 0: wend
endif
endif
swstat = 0
goto main
Channel5:
pause 25 ; debounce
if sw5 = 0 then
if led5 = 0 or swstat = 1 then
if led5 = 0 then sound pz,[123,10]: high led5
pause 300
swstat = 1
l=l+1
if l => 5 then
for i = 1 to 11: toggle led5: sound pz,[123,10]: pause 50: next i
goto Bprog5
else
goto Channel5
endif
else
low led5: low tr5: sound pz,[123,10]
pause 100
while sw5 = 0: wend
endif
endif
swstat = 0
goto main
Channel6:
pause 25 ; debounce
if sw6 = 0 then
if led6 = 0 or swstat = 1 then
if led6 = 0 then sound pz,[123,10]: high led6
pause 300
swstat = 1
l=l+1
if l => 5 then
for i = 1 to 11: toggle led6: sound pz,[123,10]: pause 50: next i
goto Bprog6
else
goto Channel6
endif
else
low led6: low tr6: sound pz,[123,10]
pause 100
while sw6 = 0: wend
endif
endif
swstat = 0
goto main
Bprog1:
WHILE !T0IF : WEND
TMR0 = 225
T0IF = 0
IF Counters(0) > 0 THEN Counters(0) = Counters(0) - 1
IF Counters(0) = 0 THEN
if y = 0 then y = 3
if y > 12 then y = 12
write 0,y
for I = 1 to y: high led1:sound pz,[123,10]:pause 50:low led1: pause 50: next i
goto main
endif
if sw1 = 0 then
pause 25 ;debouce
if sw1 = 0 then
Counters[0] = DelayTime
high led1: sound pz,[123,10]: pause 25
y = y + 1: low led1
Counters[0] = DelayTime
endif
endif
goto bprog1
Bprog2:
WHILE !T0IF : WEND
TMR0 = 225
T0IF = 0
IF Counters(1) > 0 THEN Counters(1) = Counters(1) - 1
IF Counters(1) = 0 THEN
if y = 0 then y = 3
if y > 12 then y = 12
write 1,y
for I = 1 to y: high led2:sound pz,[123,10]:pause 50:low led2: pause 50: next i
goto main
endif
if sw2 = 0 then
pause 25 ;debouce
if sw2 = 0 then
Counters[1] = DelayTime
high led2: sound pz,[123,10]: pause 25
y = y + 1: low led2
Counters[1] = DelayTime
endif
endif
goto bprog2
Bprog3:
WHILE !T0IF : WEND
TMR0 = 225
T0IF = 0
IF Counters(2) > 0 THEN Counters(2) = Counters(2) - 1
IF Counters(2) = 0 THEN
if y = 0 then y=3
if y > 12 then y = 12
write 2,chargetime(2)
for I = 1 to y: high led3:sound pz,[123,10]:pause 50:low led3: pause 50: next i
goto main
endif
if sw3 = 0 then
pause 25 ;debouce
if sw3 = 0 then
Counters[2] = DelayTime
high led3: sound pz,[123,10]: pause 25
y = y + 1: low led3
Counters[2] = DelayTime
endif
endif
goto bprog3
Bprog4:
WHILE !T0IF : WEND
TMR0 = 225
T0IF = 0
IF Counters(3) > 0 THEN Counters(3) = Counters(3) - 1
IF Counters(3) = 0 THEN
if y = 0 then y = 3
if y > 12 then y = 12
write 3,y
for I = 1 to y: high led4:sound pz,[123,10]:pause 50:low led4: pause 50: next i
goto main
endif
if sw4 = 0 then
pause 25 ;debouce
if sw4 = 0 then
Counters[3] = DelayTime
high led4: sound pz,[123,10]: pause 25
y = y + 1: low led4
Counters[3] = DelayTime
endif
endif
goto bprog4
Bprog5:
WHILE !T0IF : WEND
TMR0 = 225
T0IF = 0
IF Counters(4) > 0 THEN Counters(4) = Counters(4) - 1
IF Counters(4) = 0 THEN
if y = 0 then y = 3
if y > 12 then y = 12
write 4,y
for I = 1 to y: high led5:sound pz,[123,10]:pause 50:low led5: pause 50: next i
goto main
endif
if sw5 = 0 then
pause 25 ;debouce
if sw5 = 0 then
Counters[4] = DelayTime
high led5: sound pz,[123,10]: pause 25
y = y + 1: low led5
Counters[4] = DelayTime
endif
endif
goto bprog5
Bprog6:
WHILE !T0IF : WEND
TMR0 = 225
T0IF = 0
IF Counters(5) > 0 THEN Counters(5) = Counters(5) - 1
IF Counters(5) = 0 THEN
if y = 0 then y = 3
if y > 12 then y = 12
write 5,y
for I = 1 to y: high led6:sound pz,[123,10]:pause 50:low led6: pause 50: next i
goto main
endif
if sw6 = 0 then
pause 25 ;debouce
if sw6 = 0 then
Counters[5] = DelayTime
high led6: sound pz,[123,10]: pause 25
y = y + 1: low led6
Counters[5] = DelayTime
endif
endif
goto bprog6
StartCharge1:
high TR1:
return
StartCharge2:
high TR2:
return
StartCharge3:
high TR3:
return
StartCharge4:
high TR4:
return
StartCharge5:
high TR5:
return
StartCharge6:
high TR6:
return
Bookmarks