Extended time delay

69-cat

Member
What can I use or how can I setup a controller that would trigger an output every 60 or 90 minutes.
Dave
 

premelec

Senior Member
What sort of accuracy do you need? There are a variety of ways to do it if not _very_ accurate...
 

Bill.b

Senior Member
This will give you a delay of approximate 60 min at 4mHz, the pause can be changed for other
values of mHz

For w1 = 1 to 3600
pause 1000
next w1

Bill
 

AllyCat

Senior Member
Hi,

There's also DO : WAIT 3600 : PULSOUT pin , width : LOOP , or if you want the (M2) PICAXE to also do other stuff :
Code:
do
  do
;      Flash a LED or whatever else you want
  loop until time > 3600
  PULSOUT c.1 , 1000   ; Pulse pin c.1 for 1 second
  time = 0
loop
Reduce the 3600 to around 3 to test in the Simulator, or increase to 5400 for 1.5 hours.

Cheers, Alan.
 

AllyCat

Senior Member
Hi,

If accuracy is of no concern and no other processing is required, then you can also save battery power with a SLEEP command. For example:
Code:
symbol ONEHOUR = 36000 / 23   ; Sleeptimer is ~ 2.3 seconds
do
  sleep ONEHOUR
  pulsout  c.1 , 1000    ; Pulse a pin
loop
Cheers, Alan.
 

69-cat

Member
I am working on a device that will deliver a Covid-19 PSA over our PA system in our warehouse using a DFPlayer Mini MP3 using serial for each MP3 file. I tested the idea using my Halloween MP3 players ( funny to hear Halloween sounds coming from the PA system ) but anyhow, it worked. I have a handfull of PSA files to use just want to deliver one at a time within a 60 to 90 minute.
Dave
 
Top