longer delays

hippy

Technical Support
Staff member
This will pause for about an hour ...

- FOR w0 = 1 TO 60 ' 60 minutes
- PAUSE 60000 ' 60s
- NEXT

Edited by - hippy on 11/05/2006 03:56:27
 

Rickharris

Senior Member
<code><pre><font size=2 face='Courier'>

start:
pause 1000 ' adjust for accuracy
B0=B0+1
if B0=60 then min
goto start

min:
b0=0
B1=B1+1
if B1=60 then hr
goto start

hr:
B0=0
B1=0
B2=B2+1
if B2=13 then reset
goto start

reset:
B2=0

goto start

</font></pre></code>

B0 holds seconds
B1 holds mins
B2 holds hours

Pick out what you need
 

Jeremy Leach

Senior Member
<b> Approximate </b> 12 hour delay, unless you're running the PICAXE from a crystal.

For instance if the internal clock is running 92% of 4MHz then the delay will be 13 hours not 12.

Even a crystal-driven PICAXE won't give exactly the right delay because of the miniscule delays in processing the commands. There's over 2000 command steps executed in your loop so this will have a small effect.


Edited by - jeremy leach on 12/05/2006 08:36:33
 
Top