Brilliant, thanks!!!
I've attached my now working example (again many thanks to Bruno!) in case anyone is interested with explanations below for 1 camera and 2 channels (so 4 ROIs).
I ended up not actually using the ExpressionTransform, not because it doesn't work (it does), but because I wanted the stimulus to switch to the other side once one ROI was activated.
For that, I found an example on this forum that just sets a repeat loop of sequentially doing one task for one ROI and then switches to the other:
Quick bonus question: Could anyone please explain why using and Amb node that select the first sequence to react out of two observable sequences, followed by a repeat, stays on the first sequence instead of again checking both which one goes first? Just in case I didn't want to initialize which side the organism has to go first in order to activate a trigger.
Main workflow (for now just for the first camera, which here captures 2 channels simultaneously by different ROIs):
Arduino Update receives integers once from each channel once an ROI has been activated, accumulates all together and passes it to the Serial Port to the Arduino, which decodes it bitwise to set the LEDs in each channel. (Arduino code attached as well)
The Add here just adds 1 to the total 32 bit in, the reason being that Serial.parseInt in arduino returns back 0 immediately after a Serial String has been sent, negating the setting of the number, so I make sure it's always at least 1 and then just substract 1 again when decoding bitRead.
Camera 1 Workflow:
4 ROIs are cropped, pixels after thresholding are counted and published for ROI Activation below.
For each channel, a repeat loop checks first one side, and once Condition is met, passes it on to the other side.
Channel 1 workflow for one side Roi1A:
Condition contains the GreaterThan Threshold that will trigger sending of the channel ID as bits 2^n (so 2, 4, 8, etc....) to Arduino Update
Channel 1 workflow for other side Roi1B:
multiplies by -1 to remove the count in accumulate like Bruno suggested above using ExpressionTransform
Any further suggestions for improvement are welcome, especially regarding the above mentioned issues with setting the repeat loop such that you don't have to fix the order in which it first has to get activated.
Best and again many thanks,
Franz