How to change all the leds on en16 with immediate_send?

Hi!
I have a Bu16 that has one button that changes the led color of the first pot on a ENC16 with:

immediate_send(-1,0,‘led_color(0, 1, 105, 255, 8)’)

How can I do the same for the whole ENC16 module pot leds?

I cant figure this out,

Cheers

1 Like

Are you wanting to set all LEDs to the same color/value at the same time?

Use a ‘for’ loop to call ‘immediate_send()’ for as many elements as there are in the EN16 module.

1 Like

To limit the amount of serial communication required between modules, I suggest you avoid calling immediate_send() in a for loop.

Instead, define a global function called update_leds in the EN16 module Setup. It can take the same arguments as led_color, and update each LED in a for loop. That way you only need to call immediate_send(-1, 0, 'update_leds(0, 1, 105, 255, 8)') once.

1 Like