• E2 Is there a way to apply interval to a specific part of code?
    2 replies, posted
Hello:) I need to ping E2 chip or chips every 5 seconds. I tried doing it like: interval(5000) dsSend(“pingchip”, “group”, “”) if(dsClk) {e2 online} else {offline} But this code is strange, cause it affects another part of code. What is another way to go around it? Maybe something with functions? Or separate chip, that will ping chips? Thanks in advance!
[code]interval(5000) if (clk()) { dsSend(“pingchip”, “group”, “”) } elseif(dsClk) { e2 online } else { offline }[/code] Anything in clk() only happens when the e2 is run by interval. I'm not sure E2s are triggered by data signals from themselves, though.
I may be wrong, but you can use timers[code]timer("5sec", 5000) if (clk("5sec")) { # code timer("5sec", 5000) }[/code](last time touched E2 ~2 years ago) [I]Just tested it and [B]it works[/B][/I]
Sorry, you need to Log In to post a reply to this thread.