Jump to content

Detect which is the last element to change?


Recommended Posts

Hello,

I have a set of 50 LED and I want to be able to log which one of them was the last LED to turn on. I imagine I have to place them all to an array, but I have no clue as to how to detect the last LED that turns on.

Any ideas?

Thank you in advance

Link to post
Share on other sites

Maybe you can use the event structure with value change events, the event structure also gives the time when the event occured

Expanding on this, put all of the LEDs' Value Change events in one case. Wire the CtrlRef terminal into a shift register (or FG, if it's merited) and then you'll be able to use that reference to refer to the LED last updated.

Link to post
Share on other sites

If putting the LEDs in an array or a cluster an option, instead of having individual LEDs and then adding them to one event case, it would make the whole thing easier. Then you can just use the the single value change event for the array/cluster, which will give you the old and new values and then you can

If you XOR the old and new values, all the changed booleans will be True.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.