20x2 Retic 5 station 3 digit 7 segment led display
Recently my rigdel retic controller packed up
i recycled some of the parts and ended up with a
5 station controller.
Runs as soon as power is turned on
displays station 1 and counts down from 20 minutes
and cycles through to station 5 which is not used 00 minutes.
push the button can be paused push again to restart.
push the button a bit longer and stations can be manually controlled
if the push button is continually held down switches off
Recently my rigdel retic controller packed up
i recycled some of the parts and ended up with a
5 station controller.
Runs as soon as power is turned on
displays station 1 and counts down from 20 minutes
and cycles through to station 5 which is not used 00 minutes.
push the button can be paused push again to restart.
push the button a bit longer and stations can be manually controlled
if the push button is continually held down switches off
Code:
main:
let dirsb = %11111111
let dirsc = %10111111
let pinsb=35 pause 1 let pinsb=255 pause 1
low a.0 let pinsb=171 pause 1 let pinsb=255 pause 1 high a.0
if pinc.6=1 then main
start1:high c.0 high c.1 let w0=120 goto display
start2:low c.1 high c.2 let w0=220 goto display
start3:low c.2 high c.3 let w0=320 goto display
start4:low c.3 high c.4 let w0=420 goto display
start5:low c.4 high c.5 let w0=500 goto display
paus: let b15 = pinsc
let pinsc = %10000000
for b16 =1 to 250
let pinsb= 12 pause 1let pinsb=255 pause 3
if pinc.6 =0 then p
next b16
for b17 =1 to 250
let pinsb= 43 pause 1let pinsb=255 pause 3
if pinc.6 =0 then n
next b17
of:
low c.7 let pinsb=192 pause 2 let pinsb=255 high c.7
let pinsb=14 pause 3 let pinsb=255
low a.0 let pinsb=142 pause 2 let pinsb=255 high a.0
if pinc.6=1 then of
goto finish
N:let pinsb=43 pause 1 let pinsb=255 pause 4
if pinc.6=1 then s1
goto n
s1: for b18=1 to 250
low c.7 let pinsb=249 pause 1 let pinsb=255 pause 1 high c.7
high c.0 high c.1
next b18
if pinc.6=0 then s1
if pinc.6=1 then s2
s2: for b18=1 to 250
low c.7 let pinsb=164 pause 1 let pinsb=255 pause 1 high c.7
low c.1 high c.2
next b18
if pinc.6=0 then s2
if pinc.6=1 then s3
s3: for b18=1 to 250
low c.7 let pinsb=176 pause 1 let pinsb=255 pause 1 high c.7
low c.2 high c.3
next b18
if pinc.6=0 then s3
if pinc.6=1 then s4
s4: for b18=1 to 250
low c.7 let pinsb=153 pause 1 let pinsb=255 pause 1 high c.7
low c.3 high c.4
next b18
if pinc.6=0 then s4
if pinc.6=1 then s5
s5: for b18=1 to 250
low c.7 let pinsb=146 pause 1 let pinsb=255 pause 1 high c.7
low c.4 high c.5
next b18
if pinc.6=0 then s5
if pinc.6=1 then of
P:let pinsb=12 pause 1 let pinsb=255 pause 4
if pinc.6=1 then pausof
goto p
pausof:if pinc.6=1 then pausof let pinsc = b15
Display:
SETTIMER T1S_8
TIMER = 0
if w0 =100 then start2
if w0 =200 then start3
if w0 =300 then start4
if w0 =400 then start5
if w0 =500 then finish
DISPLAY1:
if pinc.6 = 1 then paus
let b10 = w0 dig 2
let b11 = w0 dig 1
let b12 = w0 dig 0
on b10 goto btn1,btn1,btn2,btn3,btn4,btn5
btn1: let b10 =249 goto Digit100c
btn2: let b10 =164 goto Digit100c
btn3: let b10 =176 goto Digit100c
btn4: let b10 =153 goto Digit100c
btn5: let b10 =146 goto Digit100c
Digit100c:
low c.7
let pinsb = b10
pause 1
let pinsb = 255
on b11 goto d00,d10,d20,d30,d40,d50,d60,d70,d80,d90
d00: let b11 =64 goto Digit10b
d10: let b11 =121 goto Digit10b
d20: let b11 =36 goto Digit10b
d30: let b11 =48 goto Digit10b
d40: let b11 =25 goto Digit10b
d50: let b11 =18 goto Digit10b
d60: let b11 =2 goto Digit10b
d70: let b11 =120 goto Digit10b
d80: let b11 =0 goto Digit10b
d90: let b11 =16 goto Digit10b
Digit10b:
high c.7
let pinsb = b11
pause 1
let pinsb = 255
on b12 goto d0,d1,d2,d3,d4,d5,d6,d7,d8,d9
d0: let b12 =192 goto Digit1a
d1: let b12 =249 goto Digit1a
d2: let b12 =164 goto Digit1a
d3: let b12 =176 goto Digit1a
d4: let b12 =153 goto Digit1a
d5: let b12 =146 goto Digit1a
d6: let b12 =130 goto Digit1a
d7: let b12 =248 goto Digit1a
d8: let b12 =128 goto Digit1a
d9: let b12 =144 goto Digit1a
Digit1a:
low a.0
let pinsb = b12
pause 1
let pinsb = 255
high a.0
IF TIMER < 60 THEN display1
w0=w0-1goto display
finish:let pinsc = 0 pause 1000
sw:
high c.7 pause 2000
if pinc.6 =1 then main
low c.7 pause 100
goto sw
Attachments
-
140.7 KB Views: 128
-
91.3 KB Views: 97
Last edited: