Hello All,
I have been making a binary clock which has been all fine and dandy up until now. I have just finished it, but a problem developed after about 5 minutes of use, which will not go away now.
The clock should wait for the time to increment by 1 minute before making any changes.
What is now happening is that the clock resets its self after about 100ms which i am assuming is the pause after the do until command.
Like i say, there was not problem, this exact code was working for the first 5 ish minutes of testing. and now it wont work even after a reset or re-downloading the program.
<code><pre><font size=2 face='Courier'>
Symbol Hours = b0
Symbol Minutes = b1
Init:
let dirsc = 255
Hours = 17
Minutes = 43
timer = 0
settimer 49904 'set the timer to tick every second allowing for code execution
goto SetTime
Main:
Do until timer = 60
pause 100
let b7 = timer & 1
if b7 = 1 then
high 7
else
low 7
endif
loop
timer = 0
'increment 1 minute on the display
Minutes = Minutes + 1
If Minutes = 60 then
Minutes = 0
Hours = Hours + 1
if Hours = 24 then
Hours = 0
endif
endif
SetTime:
b6 = Minutes rev 8
let outpins = Hours ^ $80
let pinsc = b6
goto Main
</font></pre></code>
any help would be great! Ben
I have been making a binary clock which has been all fine and dandy up until now. I have just finished it, but a problem developed after about 5 minutes of use, which will not go away now.
The clock should wait for the time to increment by 1 minute before making any changes.
What is now happening is that the clock resets its self after about 100ms which i am assuming is the pause after the do until command.
Like i say, there was not problem, this exact code was working for the first 5 ish minutes of testing. and now it wont work even after a reset or re-downloading the program.
<code><pre><font size=2 face='Courier'>
Symbol Hours = b0
Symbol Minutes = b1
Init:
let dirsc = 255
Hours = 17
Minutes = 43
timer = 0
settimer 49904 'set the timer to tick every second allowing for code execution
goto SetTime
Main:
Do until timer = 60
pause 100
let b7 = timer & 1
if b7 = 1 then
high 7
else
low 7
endif
loop
timer = 0
'increment 1 minute on the display
Minutes = Minutes + 1
If Minutes = 60 then
Minutes = 0
Hours = Hours + 1
if Hours = 24 then
Hours = 0
endif
endif
SetTime:
b6 = Minutes rev 8
let outpins = Hours ^ $80
let pinsc = b6
goto Main
</font></pre></code>
any help would be great! Ben