Dear Sir BeaniebBolt and AllIt is possible to make timers exceed many YEARS if you want to.
For example:
For w0 = 0 to 65535
Pause 1000
Next w0
would give a delay of just over 18 hours.
; wait for years ,days, hours
; if you dont want constants, use #symbol instead:
#DEFINE years 1
#DEFINE days 10
#DEFINE hours 6
Main:
for w0 = 1 to years
gosub year_pause
next
for w0=1 to days
gosub day_pause
next
for w0=1 to hours
gosub hour_pause
next
stop
year_pause:
for w1=1 to 365
gosub day_pause
next
return
day_pause
for w2=1 to 24
gosub hour_pause
next
return
hour_pause:
for w3=1 to 3600
pause 1000
next
return
#picaxe 08m2
#no_data
#terminal 4800
symbol minute = b1
symbol hour = b2
symbol week = b3
symbol year = w2
year = 2019
do
for week = 1 to 52 ; weeks in a year
for hour = 0 to 167 ; 168 hours in a week = 24 * 7
for minute = 0 to 59 ; 60 minutes in an hour
; wait 60 ; Seconds (or pause 60000) for one minute
sertxd("Week ",#week," hrs : min ",#hour,":",#minute,cr,lf)
next minute
next hour
next week
year = year + 1
sertxd(#year, " Another Year Gone",cr,lf)
loop
#picaxe 08
; #no_data ; Not with an 08
#terminal 2400
symbol minute = b1
symbol hour = b2
symbol week = b3
symbol year = b4
symbol century = b5
symbol millions = w3
millions = 14000 ; About 14 billion years ;-)
century = 20
year = 19
week = 43
hour = 167 ; Will wrap-around soon
do ; Each million years
do ; Each century
do ; Each year
serout 0,n2400_4,("Year ",#millions,#century,#year,cr,lf)
do ; Each week
do ; Each hour
do ; Each minute
serout 0,n2400_4,("Week ",#week," hour ",#hour," minute ",#minute,cr,lf)
; wait 60 ; Seconds
minute = minute + 1 // 60
loop until minute = 0 ; Minute has wrapped around
hour = hour + 1 // 168 ; Hours numbered 0 .. 167 (1 week)
loop until hour = 0 ; Hour has wrapped around
week = week // 52 + 1 ; Weeks numbered 1 .. 52
loop until week = 1 ; Week has wrapped around
year = year + 1 // 100
loop until year = 0 ; Year has wrapped
century = century + 1 // 10000
loop until century = 0 ; Century has wrapped
millions = millions + 1
loop