Programming control box on Luke ROTJ saber

So I’m very comfortable updating the proffie OS, adding fonts, making blade styles and have done it on two sabers already. I just got a Luke ROTJ hero saber and it is my first saber that has accent LED. I went onto Fett’s library and made the style to program the accent LEDs. This is what I get:

/* copyright Fett263 (Accent LED / PCB) OS6 Style

https://fett263.com/fett263-proffieOS6-style-library.html#Rotoscope

OS6.7 v4.016

Single Style

On Behavior: Luke ROTJ (Red Arrow)

Off Behavior: Luke ROTJ (Red Arrow)

Base Color: Rgb<255,0,0> (0)

--Effects Included--

Ignition Effect: Instant

Retraction Effect: Instant

*/

StylePtr<Layers<TransitionLoop<Black,TrConcat<TrDelay<3000>,RgbArg<BASE_COLOR_ARG,Rgb<255,0,0>>,TrBoing<2000,5>>>,InOutTrL<TrInstant,TrInstant,TransitionLoop<Black,TrConcat<TrDelay<3000>,RgbArg<OFF_COLOR_ARG,Rgb<255,0,0>>,TrBoing<2000,5>>>>>>(),

/* copyright Fett263 (Accent LED / PCB) OS6 Style

https://fett263.com/fett263-proffieOS6-style-library.html#Rotoscope

OS6.7 v4.016

Single Style

On Behavior: Luke ROTJ (Green Arrow)

Off Behavior: Luke ROTJ (Green Arrow)

Base Color: Rgb<0,255,0> (0)

--Effects Included--

Ignition Effect: Instant

Retraction Effect: Instant

*/

StylePtr<Layers<TransitionLoop<RgbArg<BASE_COLOR_ARG,Rgb<0,255,0>>,TrConcat<TrBoing<3000,9>,Black,TrDelay<2000>>>,InOutTrL<TrInstant,TrInstant,TransitionLoop<RgbArg<OFF_COLOR_ARG,Rgb<0,255,0>>,TrConcat<TrBoing<3000,9>,Black,TrDelay<2000>>>>>>(),

Would I just insert this code before the main blade style, after the main blade style, or within the main blade style?

Thanks.

The answer actually depends on where your accent LED is defined within your blades array. In most cases, people prefer to have their main blade first and accent LEDs afterwards, in which case the style you pasted would go after the main blade style.

So it would look like this? :

{ "ReturnV2;common", "ReturnV2/tracks/Sail_Barge.wav",

/* copyright Fett263 Rotoscope (Primary Blade) OS6 Style
https://fett263.com/fett263-proffieOS6-style-library.html#Rotoscope
OS6.7 v4.014
This Style Contains 3 Unique Combinations
Style Options:
Default (0): Hyper Responsive Rotoscope (Original Trilogy)
1: Audio Rotoscope - Two Color (Original Trilogy)
2: Rotoscope - Two Color (Original Trilogy)

Base Color: Rgb<0,255,0> (0)

--Effects Included--
Ignition Effect: Standard Ignition
Retraction Effect: Standard Retraction
Lockup Effect: Intensity Lockup V1, Begin Effect: Real Clash, End Effect: Full Blade Absorb
LightningBlock Effect: Responsive Lightning Block
Drag Effect: Intensity Sparking Drag
Melt Effect: Intensity Melt
Blast Effect: Blast Wave (Random)
Clash Effect: Real Clash V1
*/
StylePtr<Layers<ColorSelect<IntArg<STYLE_OPTION_ARG,0>,TrInstant,Mix<HoldPeakF<SwingSpeed<250>,Scale<SwingAcceleration<100>,Int<50>,Int<500>>,Scale<SwingAcceleration<>,Int<20000>,Int<10000>>>,RandomFlicker<StripesX<Int<15000>,Scale<HoldPeakF<SwingSpeed<200>,Scale<SwingAcceleration<100>,Int<50>,Int<300>>,Scale<SwingAcceleration<100>,Int<24000>,Int<16000>>>,Int<-3200>,Int<-200>>,RgbArg<BASE_COLOR_ARG,Rgb<0,255,0>>,RgbArg<BASE_COLOR_ARG,Rgb<0,255,0>>,Mix<Int<7710>,Black,RgbArg<BASE_COLOR_ARG,Rgb<0,255,0>>>,RgbArg<BASE_COLOR_ARG,Rgb<0,255,0>>,Mix<Int<19276>,Black,RgbArg<BASE_COLOR_ARG,Rgb<0,255,0>>>>,RgbArg<BASE_COLOR_ARG,Rgb<0,255,0>>>,RgbArg<BASE_COLOR_ARG,Rgb<0,255,0>>>,AudioFlicker<Stripes<10000,-2600,RgbArg<BASE_COLOR_ARG,Rgb<0,255,0>>,RgbArg<BASE_COLOR_ARG,Rgb<0,255,0>>,RgbArg<ALT_COLOR_ARG,Rgb<50,255,50>>,RgbArg<BASE_COLOR_ARG,Rgb<0,255,0>>,Mix<Int<16448>,Black,RgbArg<ALT_COLOR_ARG,Rgb<50,255,50>>>>,RgbArg<BASE_COLOR_ARG,Rgb<0,255,0>>>,RandomFlicker<Stripes<10000,-2600,RgbArg<BASE_COLOR_ARG,Rgb<0,255,0>>,RgbArg<BASE_COLOR_ARG,Rgb<0,255,0>>,RgbArg<ALT_COLOR_ARG,Rgb<50,255,50>>,RgbArg<BASE_COLOR_ARG,Rgb<0,255,0>>,Mix<Int<16448>,Black,RgbArg<ALT_COLOR_ARG,Rgb<50,255,50>>>>,RgbArg<BASE_COLOR_ARG,Rgb<0,255,0>>>>,MultiTransitionEffectL<TrWaveX<RgbArg<BLAST_COLOR_ARG,Rgb<255,244,157>>,Scale<EffectPosition<EFFECT_BLAST>,Int<100>,Int<400>>,Int<100>,Scale<EffectPosition<EFFECT_BLAST>,Int<100>,Int<400>>,Scale<EffectPosition<EFFECT_BLAST>,Int<28000>,Int<8000>>>,EFFECT_BLAST>,Mix<IsLessThan<ClashImpactF<>,Int<26000>>,TransitionEffectL<TrConcat<TrInstant,AlphaL<RgbArg<CLASH_COLOR_ARG,Rgb<255,244,157>>,Bump<Scale<BladeAngle<>,Scale<BladeAngle<0,16000>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<-12000>>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<10000>>>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<-10000>>>,Scale<ClashImpactF<>,Int<12000>,Int<60000>>>>,TrFadeX<Scale<ClashImpactF<>,Int<200>,Int<400>>>>,EFFECT_CLASH>,TransitionEffectL<TrWaveX<RgbArg<CLASH_COLOR_ARG,Rgb<255,244,157>>,Scale<ClashImpactF<>,Int<100>,Int<400>>,Int<100>,Scale<ClashImpactF<>,Int<100>,Int<400>>,Scale<BladeAngle<>,Scale<BladeAngle<0,16000>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<-12000>>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<10000>>>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<-10000>>>>,EFFECT_CLASH>>,LockupTrL<TransitionEffect<AlphaMixL<Bump<Scale<BladeAngle<>,Scale<BladeAngle<0,16000>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<-12000>>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<10000>>>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<-10000>>>,Scale<SwingSpeed<100>,Int<14000>,Int<18000>>>,BrownNoiseFlickerL<RgbArg<LOCKUP_COLOR_ARG,Rgb<255,244,157>>,Int<200>>,StripesX<Int<1800>,Scale<NoisySoundLevel,Int<-3500>,Int<-5000>>,Mix<Int<6425>,Black,RgbArg<LOCKUP_COLOR_ARG,Rgb<255,244,157>>>,RgbArg<LOCKUP_COLOR_ARG,Rgb<255,244,157>>,Mix<Int<12850>,Black,RgbArg<LOCKUP_COLOR_ARG,Rgb<255,244,157>>>>>,AlphaL<AudioFlicker<RgbArg<LOCKUP_COLOR_ARG,Rgb<255,244,157>>,Mix<Int<10280>,Black,RgbArg<LOCKUP_COLOR_ARG,Rgb<255,244,157>>>>,Bump<Scale<BladeAngle<>,Scale<BladeAngle<0,16000>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<-12000>>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<10000>>>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<-10000>>>,Int<13000>>>,TrJoin<TrDelay<8000>,TrInstant>,TrFade<3000>,EFFECT_LOCKUP_BEGIN>,TrConcat<TrJoin<TrDelay<50>,TrInstant>,Mix<IsLessThan<ClashImpactF<>,Int<26000>>,RgbArg<LOCKUP_COLOR_ARG,Rgb<255,244,157>>,AlphaL<RgbArg<LOCKUP_COLOR_ARG,Rgb<255,244,157>>,Bump<Scale<BladeAngle<>,Scale<BladeAngle<0,16000>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<-12000>>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<10000>>>,Sum<IntArg<LOCKUP_POSITION_ARG,16000>,Int<-10000>>>,Scale<ClashImpactF<>,Int<20000>,Int<60000>>>>>,TrFade<300>>,TrConcat<TrInstant,RgbArg<LOCKUP_COLOR_ARG,Rgb<255,244,157>>,TrFade<400>>,SaberBase::LOCKUP_NORMAL>,ResponsiveLightningBlockL<Strobe<RgbArg<LB_COLOR_ARG,Rgb<255,255,255>>,AudioFlicker<RgbArg<LB_COLOR_ARG,Rgb<255,255,255>>,Blue>,50,1>,TrConcat<TrInstant,AlphaL<RgbArg<LB_COLOR_ARG,Rgb<255,255,255>>,Bump<Int<12000>,Int<18000>>>,TrFade<200>>,TrConcat<TrInstant,HumpFlickerL<AlphaL<RgbArg<LB_COLOR_ARG,Rgb<255,255,255>>,Int<16000>>,30>,TrSmoothFade<600>>>,LockupTrL<AlphaL<RandomPerLEDFlickerL<RgbArg<DRAG_COLOR_ARG,Rgb<255,255,255>>>,SmoothStep<IntArg<DRAG_SIZE_ARG,28000>,Int<3000>>>,TrConcat<TrJoin<TrDelay<4000>,TrWipeIn<200>>,AlphaL<BrownNoiseFlickerL<RgbArg<DRAG_COLOR_ARG,Rgb<255,255,255>>,Int<300>>,SmoothStep<IntArg<DRAG_SIZE_ARG,28000>,Int<3000>>>,TrFade<4000>>,TrFade<300>,SaberBase::LOCKUP_DRAG>,LockupTrL<AlphaL<Remap<Scale<RampF,Int<65536>,Int<0>>,StaticFire<Mix<TwistAngle<>,RgbArg<STAB_COLOR_ARG,Rgb<255,24,0>>,RotateColorsX<Int<3000>,RgbArg<STAB_COLOR_ARG,Rgb<255,24,0>>>>,Mix<TwistAngle<>,RotateColorsX<Int<3000>,RgbArg<STAB_COLOR_ARG,Rgb<255,24,0>>>,RotateColorsX<Int<3000>,Mix<Int<12000>,Black,RgbArg<STAB_COLOR_ARG,Rgb<255,24,0>>>>>,0,3,5,3000,10>>,SmoothStep<IntArg<MELT_SIZE_ARG,28000>,Int<4000>>>,TrConcat<TrWipeIn<100>,AlphaL<RgbArg<STAB_COLOR_ARG,Rgb<255,24,0>>,SmoothStep<IntArg<MELT_SIZE_ARG,28000>,Int<4000>>>,TrJoin<TrDelay<4000>,TrFade<300>>,AlphaL<Mix<TwistAngle<>,RgbArg<STAB_COLOR_ARG,Rgb<255,24,0>>,RotateColorsX<Int<3000>,RgbArg<STAB_COLOR_ARG,Rgb<255,24,0>>>>,SmoothStep<IntArg<MELT_SIZE_ARG,28000>,Int<4000>>>,TrFade<4000>>,TrWipe<200>,SaberBase::LOCKUP_MELT>,InOutTrL<TrWipeX<IgnitionTime<300>>,TrWipeInX<RetractionTime<0>>,Black>>>StylePtr<Layers<TransitionLoop<Black,TrConcat<TrDelay<3000>,RgbArg<BASE_COLOR_ARG,Rgb<255,0,0>>,TrBoing<2000,5>>>,InOutTrL<TrInstant,TrInstant,TransitionLoop<Black,TrConcat<TrDelay<3000>,RgbArg<OFF_COLOR_ARG,Rgb<255,0,0>>,TrBoing<2000,5>>>>>>StylePtr<Layers<TransitionLoop<RgbArg<BASE_COLOR_ARG,Rgb<0,255,0>>,TrConcat<TrBoing<3000,9>,Black,TrDelay<2000>>>,InOutTrL<TrInstant,TrInstant,TransitionLoop<RgbArg<OFF_COLOR_ARG,Rgb<0,255,0>>,TrConcat<TrBoing<3000,9>,Black,TrDelay<2000>>>>>>(),"Luke"},
  

Not quite. Each blade style is its own entry, separated by commas, not strung together with the main blade code.
You’d want to literally paste the 2 arrow styles, copyright info and all, between the main blade style and the ending “name” argument, so like:

{ "ReturnV2;common", "ReturnV2/tracks/Sail_Barge.wav",

/* copyright.....*/
StylePtr<...Main blade style...>(),

/* copyright.....*/
StylePtr<...Red arrow style...>(),

/* copyright.....*/
StylePtr<...Green arrow style...>(), "Luke"},

Yeah I tried verifying the sketch right now and realized that mistake so I corrected it.

Only part I’m stuck on now is what I put at the bottom in the blade array section. This is the error message I get when I run the sketch:






















In file included from C:\Users\Owner\Desktop\ProffieOS-v6.7\ProffieOS\ProffieOS.ino:538:

C:\Users\Owner\Desktop\ProffieOS-v6.7\ProffieOS\config\LukeHeroconfig.h:200:109: error: cannot convert 'Preset*' to 'BladeBase*' in initialization

  200 |  { 0, WS281XBladePtr<133, bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3> >(), CONFIGARRAY(presets) },

      |                                                                                                             ^~~~~~~

      |                                                                                                             |

      |                                                                                                             Preset*

C:\Users\Owner\Desktop\ProffieOS-v6.7\ProffieOS\common\preset.h:6:24: note: in definition of macro 'CONFIGARRAY'

    6 | #define CONFIGARRAY(X) X, NELEM(X)

      |                        ^

ProffieOS:300:28: error: invalid conversion from 'unsigned int' to 'BladeBase*' [-fpermissive]

  300 | #define NELEM(X) (sizeof(X)/sizeof((X)[0]))

      |                  ~~~~~~~~~~^~~~~~~~~~~~~~~~

      |                            |

      |                            unsigned int

C:\Users\Owner\Desktop\ProffieOS-v6.7\ProffieOS\common\preset.h:6:27: note: in expansion of macro 'NELEM'

    6 | #define CONFIGARRAY(X) X, NELEM(X)

      |                           ^~~~~

C:\Users\Owner\Desktop\ProffieOS-v6.7\ProffieOS\config\LukeHeroconfig.h:200:97: note: in expansion of macro 'CONFIGARRAY'

  200 |  { 0, WS281XBladePtr<133, bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3> >(), CONFIGARRAY(presets) },

      |                                                                                                 ^~~~~~~~~~~

exit status 1

invalid conversion from 'unsigned int' to 'BladeBase*' [-fpermissive]



This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

NUM_BLADES, number of styles per preset, and number of blades declared in BladeConfig all need to be the same amount.
You only have one blade (main) in BladeConfig.

How you write the blade totally depends on how it’s wired; Resistor/no resistor, battery power or 3.3vpad, etc…
The templates currently available in leds.h which would typically be used in the blade definition are mostly geared toward high-power LEDs like a TriCree for use in a main blade, but with proper resistors installed, can be used for a single color 20mA control box LED.
For example something like :

SimpleBladePtr<CreeXPE2WhiteTemplate<550>, NoLED, NoLED, NoLED, bladePowerPin6, -1, -1, -1>()

You can write your own struct based on the LED specs to write an accurate blade array, but I think most people don’t bother with that.

Read these:

To make life waaay easier, you could just put single addressable pixel LEDs in instead and just configure it like any pixel blade :slight_smile:

I’m not sure how it’s wired. For reference my hilt is 89 sabers like this one: https://www.youtube.com/watch?v=0k_NX_60n1U&t=331s

Only on mine the LED don’t come on until the blade is ignited and they are static. I can slide open the clamp card and make the LED blink like he does in the video by pushing the buttons but once the saber is turned off the LED turn off also. The original config file had the number of blades at 1.

I’m going to try to use the sample you provided above and see if it works.

Thanks.

Yeah but see that’s what I was saying about that helper board.
Those LEDs in that video are their own separate entity. They are controlled by their own onboard control chip, and it is a basic 3 mode LED function choice.
They are not being controlled by the Proffieboard, and without modifying that control box-switch/LED combo-electronic circuit board, you can’t write a blade style for them.

It’s a 3 mode simple thing, like they use in these foam baton toys.

I uploaded a new config file and the LEDs no longer light up at all. Is this indicative that the helper board is connected to the Proffieboard and not it’s own separate entity? The reason why the LEDS are not lighting up now is because the config file I uploaded only has number of blades at 1?

That seems likely.
Unless you dislodged a wire when you were doing the uploading of course…