As the title says... Chat on...

User avatar
By zacnotes
#24269 Hey all!
I have a piece of a function that I call:
Code: Select allif stop==0 and value=="East+Yard" then eastYard() --should only run if east yard button is pressed
      elseif value=="East+Yard" then tmr.alarm(0, DWT, 0, print("timer 0")) tmr.alarm(1, WT, 0, print ("timer 1")) stop=0 eastYard() return end


that in turn goes to a second function:
Code: Select allfunction eastYard()  -- turning on east yard sprinkler
   gpio.write(z1,gpio.LOW) gpio.write(z2,gpio.HIGH) gpio.write(z3,gpio.HIGH) print ("east yard on, stop= ") print (stop) return end


The goal is that the first part would call two separate functions, after a set period of time. In place of the functions that are called during the timer, i have a couple of prints to help me see when they are called. The problem is, they never seem to run, the prints inside the timer never get printed, but the line printed in the second function does, so it makes it that far.

Anyone got any good timer examples they could point me toward so i can figure this out?
Thanks!