Defining LED count

Is it possible to set the LED counr dynamically? Or is it possible to set the led count in the style so that it overriddes the led count in the blades config?

Im just thinking about having different blades lengths per preset for a mini display blade and a full length without having to reprogram

If you use the Sabersense prop file, you can use the Array Selector to have multiple arrays all with their own blade length. If you point each blade array to the same preset array, then the length adjust becomes global (i.e. would work across all sound fonts/presets) and you would just switch between lengths with a button press (triple clicking the power button) to get the length you want (pointing up moves forwards through the array list, pointing down moves backwards). You can then have custom wav files to announce what length you’ve switched to (a selection are provided as a free download on my website). And with strategic use of save files, you could even, if you wanted to, set it so that when you switch blade length, it also switches to your preferred sound font for that given blade length, though all fonts would still be available to switch to on all blade lengths manually.

It may sound complex under the hood (although it really isn’t) but to the saber user it’s very simple - one button control sets the sound font/preset and another one sets the blade length, and that’s it.

As an example, your blade array in your config might look something like this, and you can have as many arrays for as many blade lengths as you like:

BladeConfig blades[] = {
  { 0,  // KR v3.5 36 Inch. 
 	WS281XBladePtr<134, bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3>>(),
   CONFIGARRAY(presets) },
   
  { 1,  // KR v2 36 Inch. 
 	WS281XBladePtr<132, bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3>>(),
   CONFIGARRAY(presets) },

  { 2,  // KR v3.5 32 Inch. 
 	WS281XBladePtr<125, bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3>>(),
   CONFIGARRAY(presets) },
   
  { 3,  // KR v2 32 Inch.
 	WS281XBladePtr<122, bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3>>(),
   CONFIGARRAY(presets) },
};
#endif

Hope that helps.
:slight_smile:

Blade ID would do what you want “dynamically”, this works in any prop:

Manual Blade ID or Blade Array are also available in my prop in OS8, if you want to manually trigger, we need beta testers if you’re interested:

FETT263_MANUAL_BLADE_ID
FETT263_MANUAL_BLADE_ARRAY

New controls for above features will be listed at top of the prop file in the beta.

Beta thread is here for more info. If you do successfully test please post results so we can wrap up the beta.

Thank you this is helpful, so for clarity, if I put a 5kohm resistor in the data line of a blade then set the array ID value to 5000 that should in theory work at detecting that particular blade?

Yes, for Blade ID.

Ty, rather than having different presets for different blades, if I want the different blades to share the same presets can I just name the CONFIGARRAY the same eg

BladeConfig blades = {
{ 0, WS281XBladePtr<125, bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3> >(),
WS281XBladePtr<1, blade2Pin, Color8::GRB, PowerPINS >(),
SimpleBladePtr<CH2LED,NoLED, NoLED, NoLED,bladePowerPin4, -1,-1,-1>(),
SimpleBladePtr<CH1LED,NoLED, NoLED, NoLED,bladePowerPin5, -1,-1,-1>(),
CONFIGARRAY(presets) },

{ 5000, WS281XBladePtr<134, bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3> >(),
WS281XBladePtr<1, blade2Pin, Color8::GRB, PowerPINS >(),
SimpleBladePtr<CH2LED,NoLED, NoLED, NoLED,bladePowerPin4, -1,-1,-1>(),
SimpleBladePtr<CH1LED,NoLED, NoLED, NoLED,bladePowerPin5, -1,-1,-1>(),
CONFIGARRAY(presets) },

I believe so, haven’t actually tried though. @profezzorn ?

Yes you can use the same presets for all your blades. I have it like that on my saber.

1 Like

this is all.