Showing results for 
Search instead for 
Did you mean: 

Replace Array elements using menu ring

Go to solution


i need to change values of an array with 16 elements. Using an array control looks really bad. So i thought i can make it with an menu ring. I tried to use the menu ring value as index to change the corrosponing value. That works. But when i change the the ring element, the changed value isn't stored in the array an the initial value is restored.

I attached a minimal setup.

Maybe some of you guys can tell me whats wrong with my program.

Thank you.

0 Kudos
Message 1 of 4

You always start with an empty array with each iteration. If you want to operate on the updated array, you need to keep it in a shift register. Very basic stuff.


Your loop also needs a small wait. No need to spin millions of times per second.

0 Kudos
Message 2 of 4
Accepted by topic author FaDen93

Here's how it could look like.





Note that your index array was pointless. If you want two modes (replace current, read current), you should use a case structure and two states.

Message 3 of 4

Thanks for your help. I implemented the case structure too.


0 Kudos
Message 4 of 4