I have a goog working Lua script for Dag (Day) and nacht (night) variable.
The settings are for the variable Day and night are exactly start at sunrise or sunset.
But now i want to program 30 minuts. So the variable Dag (Day) for sunrise must start 30 minutes later and for Sunset 30 minuts earlyer.
Dous anyone now where and how i must programm a 30 minutes code?
This is my Lua code:
your loop that waits 1minute
You have a loop
Please login or register to see this code.
The problem is that the "Inside" of your loop takes a little time to execute, let's say 1ms.
That means that one loop doesn't take 1min, it takes 1min and 1ms. That means that if you started the loop exactly 22:00:00, after 1000 minutes you have drifted 1000*1ms = 1s. and it is 22:00:01
That may not seem so dangerous?
Well, assume that you started the loop at 21:59