Every other message

DvlsAdvct

2009-02-13 20:39:10

hi guys

So I want my endless rotary to send every other message for a translator. So every two clicks it sends 1 +1 or -1.

I tried this with a /2 in the rules, but the problem is that it halves the value, which I don't want.

So how, in rules, do I send every other message?

Thanks
Jared

florian

2009-02-23 11:48:52

Hi Jared,

sorry for the late reply.

You can use a global variable to track that:

Code: Select all

Rules:
 g0 = g0 + 1
 IF g0 == 2 THEN g0 = 0
 IF g0 == 1 THEN "exit rules, do not execute action"
Hope that makes sense!
Florian

DvlsAdvct

2009-02-23 19:32:42

Makes total sense. I tried something similar but I guess I over complicated it for myself (I'm good at that).

thanks a lot Florian.