Hmmm I hate clocks 88.88
on power on starts at 1.00
push the button to program
push to select hours
ie if your want 10.
push to select 9.
push and hold to get 10. then will jump to minutes 00
push to select 29
push and hold on 30 will display a dot
when you release clock starts at 10.30
dont know how acurate it is yet only being going 10 mins lol
using internal timer resets every 12 hours i hope.
on power on starts at 1.00
push the button to program
push to select hours
ie if your want 10.
push to select 9.
push and hold to get 10. then will jump to minutes 00
push to select 29
push and hold on 30 will display a dot
when you release clock starts at 10.30
dont know how acurate it is yet only being going 10 mins lol
using internal timer resets every 12 hours i hope.
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
cl:
SETTIMER T1S_8
TIMER =3600
start:
clock:
w1=Timer/3600 'time hours
w2=Timer//3600/60 'time minutes
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 hours
let pinsb = b11 : low c.3 : pause 1 'Display1
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>12 then cl 'once 12.59 is reached stops and resets to 1.00
goto clock
Hours:w1=0
hrs:w20=0
Ho:
b0=10 : if w1 < 10 then dig11 'Zero blanking
let b0 = w1 dig 1
dig11: read b0,b11
high c.2 : let pinsb = b11 : low c.3 : pause 1 'Display1
high c.1 : high c.0
let b0 = w1 dig 0
read b0,b12 : let b12=b12-128 'with d.p
high c.3 : let pinsb = b12 : low c.2 : pause 1 'Display2
if pinc.6=0 then hrs 'reset ready for next count
let w20=w20+1
if w20 > 200 then Minutes 'hold to goto Minutes
if w20 > 1 then ho 'ignores button bounce
let w1=w1+1 'Add count by 1
if w1=13 then hours 'Reset after 12 reached
goto ho
Minutes:w2=65535 ' start at 0
mins:w21=0 ' reset sw
Mi:
let b0 = w2 dig 1
read b0,b13
high c.0 : let pinsb = b13 : low c.1 : pause 1 'Display3
high c.3 : high c.2
let b0 = w2 dig 0
read b0,b14
high c.1 : let pinsb = b14 : low c.0 : pause 1 'Display4
if pinc.6=0 then mins 'reset ready for next count
let w21=w21+1
if w21 > 200 then prog 'hold to goto prog
if w21 > 1 then Mi 'ignores button bounce
let w2=w2+1 'Add count by 1
if w2=60 then minutes 'Reset after 59 reached
goto Mi
prog:
let pinsb = 127 'd.p display4
if pinc.6 = 1 then prog 'relase to program
let w2=w2*60
let timer = w1*3600+w2
goto clock
Attachments
-
173.4 KB Views: 70
Last edited: