Hi!
Glad to hear you've got this set up and are having fun with it!
You're right -- at this point, segmentation settings aren't saved when you switch away from the multisegment pattern. All the work is done on the Pixelblaze, and it doesn't save local variables when you switch..
So when you come back, you're back to the initial settings. I'm working on fixing this by storing more state in the HE driver, but for now, here's a good workaround:
To make sure your settings persist, just add them to the multisegment pattern. Once you've got the segments set up the way you like, take note of their sizes and use the pattern editor in the Pixelblaze web UI to write them into multisegment's initialize()
function.
In the pattern code at around line 207, there's a loop that goes through and initializes all the segments to their (somewhat random) default values.
// start with all zones on, equal in size, and set to random colors.
//
// IMPORTANT NOTE:
// To customize your starting segment sizes and colors, you can
// move the setup function calls (like SetSegSize and SetSegHSB)
// from this loop and call them with the setup you want.
var i;
for (i = 0; i < __n_segments; i++) { // comment this loop section out!
SetSegState(i,true);
SetSegEffect(i,0)
SetSegHSB(i,random(1),1,0.60)
SetSegSpeed(i,1);
SetSegSize(i,floor(pixelCount / __n_segments));
}
// add custom calls to segment setup functions here!
// for example, to make segment #0 50 pixels long, and bright blue,
// you would write:
// SetSegState(0,true) // on
// SetSegSize(0,50) ; // 50 pixels long
// SetSegHSB(0.6667,1,1); // blue (hue 0.6667, sat 1, bri 1)
// SetSegEffect(0,0); // no effect
// SetSegSpeed(0,1); // default speed
}
Once you know what you want, delete or comment everything in the for(i=0...) loop and
set your segments up yourself with SetSegxxx() calls. Then save the pattern, and your segment setup will be safe from pattern changes, disconnects, other users & power outages.
The SetSegxxx() calls work as follows: (where is the number of the segment you're changing, starting at 0)
SetSegState(n,true); // set initial on/off state - true = on, false = off
SetSegEffect(n,0) // set initial effect number
SetSegHSB(n,random(1),1,0.60) // set HSB color, (range for each component 0..1)
SetSegSpeed(n,1); // set starting animation speed (range 0..1)
SetSegSize(i,floor(pixelCount / __n_segments));
Hope this helps. The abililty to dive in and change whatever you need to is IMO, the best feature of the Pixelblaze vs other LED controllers. If you get stuck, ask and I'll do my best to get you going again!