init:
pause 500
serout C.1, N2400, (254,1)
pause 50
serout C.1,N2400,( 254,128,"Drops- P0- ") ;drop selection 0 is the variable, 1 to 4.
serout C.1,N2400,( 254,192,"P1- P2- ") ;P0 – P6 is the pause time between drops
serout C.1,N2400,( 254,148,"P3- P4- ") ; 0000 is the variable, adjustable from1 to 9999ms
serout C.1,N2400,( 254,212,"P5- P6- ")
pause 500
let dirsB = %11111111
keypad:
readadc 2,b0
if b0 > 176 and b0 < 180 then : b1 = 0
elseif b0 > 121 and b0 < 125 then : b1 = 1
elseif b0 > 114 and b0 < 118 then : b1 = 2
elseif b0 > 104 and b0 < 108 then : b1 = 3
elseif b0 > 148 and b0 < 152 then : b1 = 4
elseif b0 > 143 and b0 < 147 then : b1 = 5
elseif b0 > 137 and b0 < 141 then : b1 = 6
elseif b0 > 166 and b0 < 170 then : b1 = 7
elseif b0 > 162 and b0 < 166 then : b1 = 8
elseif b0 > 159 and b0 < 163 then : b1 = 9
elseif b0 > 179 and b0 < 183 then : b1 = 10
elseif b0 > 174 and b0 < 178 then : b1 = 11
end if
drops:
readadc 2,b1
if b1 = 123 then serout C.1,N2400,(254,134,"1")
endif
if b1 = 123 then let pinsB = %00000001
endif
if b1 = 116 then serout C.1,N2400,(254,134,"2")
endif
if b1 = 116 then let pinsB = %00000011
endif
if b1 = 106 then serout C.1,N2400,(254,134,"3")
endif
if b1 = 106 then let pinsB = %00000111
endif
if b1 = 150 then serout C.1,N2400,(254,134,"4")
end if
if b1 = 150 then let pinsB = %00001111
endif
if b1 = 181 then gosub P0
goto drops
P0:
readadc 2,b1
if b1 = 178 then serout C.1,N2400,(254,140,"0",254,141,"0",254,142,"0",254,143,"0")
endif
if b1 = 123 then serout C.1,N2400,(254,140,"1",254,141,"1",254,142,"1",254,143,"1")
endif
if b1 = 116 then serout C.1,N2400,(254,140,#2,254,141,#2,254,142,#2,254,143,#2)
endif
if b1 = 106 then serout C.1,N2400,(254,140,#3,254,141,#3,254,142,#3,254,143,#3)
endif
if b1 = 181 then gosub P1
goto P0
P1:
readadc 2,b1
if b1 = 178 then serout C.1,N2400,(254,195,#0,254,196,#0,254,197,#0,254,198,#0)
endif
if b1 = 123 then serout C.1,N2400,(254,195,#1,254,196,#1,254,197,#1,254,198,#1)
endif
if b1 = 116 then serout C.1,N2400,(254,195,#2,254,196,#2,254,197,#2,254,198,#2)
endif
if b1 = 106 then serout C.1,N2400,(254,195,#3,254,196,#3,254,197,#3,254,198,#3)
endif
if b1 = 150 then serout C.1,N2400,(254,195,#4,254,196,#4,254,197,#4,254,198,#4)
endif
if b1 = 145 then serout C.1,N2400,(254,195,#5,254,196,#5,254,197,#5,254,198,#5)
endif
if b1 = 139 then serout C.1,N2400,(254,195,#6,254,196,#6,254,197,#6,254,198,#6)
endif
if b1 = 168 then serout C.1,N2400,(254,195,#7,254,196,#7,254,197,#7,254,198,#7)
endif
if b1 = 164 then serout C.1,N2400,(254,195,#8,254,196,#8,254,197,#8,254,198,#8)
endif
if b1 = 161 then serout C.1,N2400,(254,195,#9,254,196,#9,254,197,#9,254,198,#9)
endif
if b1 = 181 then gosub P2
goto P1
P2:
readadc 2,b1
if b1 = 178 then serout C.1,N2400,(254,203,#0,254,204,#0,254,205,#0,254,206,#0)
endif
if b1 = 181 then gosub P3
goto P2
P3:
readadc 2,b1
if b1 = 178 then serout C.1,N2400,(254,151,#0,254,152,#0,254,153,#0,254,154,#0)
endif
if b1 = 181 then gosub P4
goto P3
P4:
readadc 2,b1
if b1 = 178 then serout C.1,N2400,(254,159,#0,254,160,#0,254,161,#0,254,162,#0)
endif
if b1 = 181 then gosub P5
goto P4
P5:
readadc 2,b1
if b1 = 178 then serout C.1,N2400,(254,215,#0,254,216,#0,254,217,#0,254,218,#0)
endif
if b1 = 181 then gosub P6
goto P5
P6:
readadc 2,b1
if b1 = 178 then serout C.1,N2400,(254,223,#0,254,224,#0,254,225,#0,254,226,#0)
endif
if b1 = 181 then gosub mainA
goto P6
mainA:
readadc 2,b1 ;b1 is the start button to run programme
if b1 = 175 then main4
goto mainA
main1: ; 1 drop
high B.7
pause 500
low B.7
goto init
mainB:
readadc 2,b1 ;b1 is the start button to run programme
if b1 = 175 then main2
goto mainB
main2: ; 2 drops
high B.7
pause 500
low B.7
pause 500
high B.7
pause 500
low B.7
goto init
mainC:
readadc 2,b1 ;b1 is the start button to run programme
if b1 = 175 then main3
goto mainC
main3: ;3 drops
high B.7
pause 500
low B.7
pause 500
high B.7
pause 500
low B.7
pause 500
high B.7
pause 500
low B.7
goto init
mainD:
readadc 2,b1 ;b1 is the start button to run programme
if b1 = 175 then main4
goto mainD
main4: ;4 drops
high B.7
pause 500
low B.7
pause 500
high B.7
pause 500
low B.7
pause 500
high B.7
pause 500
low B.7
pause 500
high B.7
pause 500
low B.7
goto init