I'm looking for a way to turn off the backlight on the display when there is no activity from the rotary encoder i.e. knob hasn't been turned.
I tried launching this code into its own cog and calling it but my main program hangs until it times out. Is there a way to have it run in the background without it affecting the main program?
I'm using the Parallax 4x20 LCD. You send a $11 to turn it on and a $12 to turn it off. I'm using Full Duplex Serial to talk to it.
I launch the WatchDog cog like this
The stack variable is a long
PUB WatchDog | t
t := cnt - 1776 ' sync with system counter
repeat 5000 ' Set delay for 5 seconds
waitcnt(t += MS_001)