Menu

pTimer.lua

Paul Hancock

This is a description of the file pTimer.lua.

line 2 this line adds the global variables defined in the file setConfig.lua as a module.

line 3 defines the local var longInterval.

line 4 same as above but without the local designator.

line 5 prints some diagnostic info

line 6 converts longInterval into minutes. no longer used!

line 7 turns the pump on for initial cycle.

lines 8 through 13 define the short timer callback function, this is what turns the pump off after the si interval in seconds.

line 14 arms the short timer for initial cycle.

in this code lines 1-7, 14 and 32 run sequentially and initially only once on startup.
the code defined in the two functions runs after the timers run to 0 respectively.
the code in function tmr4_cb() is scheduled by line 14 and the delay is determined by the value of the short interval setting times 1000 as the timer works in milli seconds.


Related

Wiki: Home