20X2 4 digit 7 segment LED stopwatch
Timer,s seem to be a popular
99 minutes 59seconds
surprised that it is very acurate!
push the button
will start .01
push again
will stop 20.10 (fif you can wait that long)
and again
to reset .00
(Hold continuously will reset)
push again to start from .00
Timer,s seem to be a popular
99 minutes 59seconds
surprised that it is very acurate!
push the button
will start .01
push again
will stop 20.10 (fif you can wait that long)
and again
to reset .00
(Hold continuously will reset)
push again to start from .00
Code:
' -- -- -- -- -- -- -- --
' b0-A | | | | | | | |
' b1-B
' B2-C | | | | | | | |
' b3-D -- -- -- -- -- -- -- --
' B4-E | | | | | | | |
' B5-F
' B6-G | | | | | | | |
' B7-dp -- -- -- -- o -- -- -- --
'
'Display 1 2 3 4
'Common anode C.3 C.2 C.1 c.0
eeprom 0,(192,249,164,176,153,146,130,248,128,144,255) 'Display (0,1,2,3,4,5,6,7,8,9,blank)
main:
let dirsb = %11111111
let dirsc = %10111111
m: b10=0
SETTIMER T1S_8
TIMER = 0
start:
w1=Timer/60 'time minutes
w2=Timer//60
'time seconds
stop1:
b0=10 : if w1 < 10 then dig1 'Zero blanking
let b0 = w1 dig 1
Dig1: read b0,b11
high c.0 : if pinc.6 = 1 then sw
let pinsb = b11 : low c.3 : pause 1 'Display1
if w1 < 1 then dig2 'Zero blanking
let b0 = w1 dig 0
Dig2: read b0,b12 : let b12=b12-128 'with d.p
high c.3 : let pinsb = b12 : low c.2 : pause 1 'Display2
let b0 = w2 dig 1
Dig3: read b0,b13
high c.2 : let pinsb = b13 : low c.1 : pause 1 'Display3
let b0 = w2 dig 0
Dig4:read b0,b14
high c.1 : let pinsb = b14 : low c.0 : pause 1 'Display4
if w1>99 then m 'once 99.59 is reached stops and resets to 00
on b10 goto m,start,stop1
sw:
let b10=b10+1 :pause 1000
if pinc.6 =1 then sw
on b10 goto m,start,stop1
if b10 > 2 then m
Attachments
-
173.4 KB Views: 102
Last edited: