timer question
#1
Posted 21 September 2012 - 09:33 PM
#2
Posted 21 September 2012 - 10:24 PM
#3
Posted 22 September 2012 - 12:33 AM
Perkunas,This is a little hard to explain so here go's
I have light on for 16 hours off for 8 forever loop
simple
I have another loop that kills the 1st one in 14 days
Is there a way to track the 1st loop
My problem is that when the main loop happens the light may have already been on 0-16 hours no way of knowing.
Would like to start it at the same time it left off.
My thinking is, I probably need an external clock.
I may have miss understood your question, but if I didn't I would would pick a loop with a time of say 1 minute. Then on each loop I would increment a counter.
In visual Basic something like this (most likely not correct, meant only to get you started)
dim OnCounter as integer = 0
dim LightOn as boolean = false
OnCounter = OnCounter + 1
LightOn = (OnCounter > 0) and (OnCounter < 961)
if OnCounter > 1440 then
OnCounter = 0
end if
Then use the OnCounter to control a relay for the light.
Also easy to do in C#
Hope this helps.
Chuck
#4
Posted 22 September 2012 - 01:36 AM
#5
Posted 22 September 2012 - 10:32 AM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users