Subblade sytax errors

I don’t use subblades that much, I keep getting a syntax error in my blades array in this piece:

BladeConfig blades[] = {
{0,SubBlade (0,4 WS281XBladePtr>145,bladepin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3>>() ),
SubBlade (5,145, NULL),
CONFIGARRAY(presets)},
};

Here is my config file for this one in entirety:

// ProffieOS7 Config File
#ifdef CONFIG_TOP
#include "proffieboard_v2_config.h"
#define NUM_BLADES 2
#define NUM_BUTTONS 1
const unsigned int maxLedsPerStrip = 144;
#define EXTRA_COLOR_BUFFER_SPACE 30
#define VOLUME 2500
#define CLASH_THRESHOLD_G 3.5
#define AUDIO_CLASH_SUPPRESSION_LEVEL 10
#define ENABLE_AUDIO
#define ENABLE_MOTION
#define ENABLE_WS2811
#define ENABLE_SD
#define KILL_OLD_PLAYERS
#define MOTION_TIMEOUT 60 * 15 * 1000
#define IDLE_OFF_TIME 60 * 15 * 1000
#define DISABLE_BASIC_PARSER_STYLES
#define DISABLE_DIAGNOSTIC_COMMANDS
#define ENABLE_ALL_EDIT_OPTIONS
#define DISABLE_TALKIE
#define NO_REPEAT_RANDOM
#define FETT263_EDIT_SETTINGS_MENU
#define FETT263_DUAL_MODE_SOUND
#define FETT263_CLASH_STRENGTH_SOUND
#define FETT263_MAX_CLASH 16
#define FETT263_SAY_COLOR_LIST
#define FETT263_SAY_BATTERY_VOLTS
#define FETT263_HOLD_BUTTON_OFF
#define FETT263_DISABLE_CHANGE_FONT
#define FETT263_DISABLE_CHANGE_STYLE
#define FETT263_DISABLE_COPY_PRESET
#define FETT263_LOCKUP_DELAY 200
#define FETT263_BM_CLASH_DETECT 6
#define FETT263_SWING_ON_SPEED 350
#define FETT263_SWING_ON
#define FETT263_TWIST_ON_PREON
#define FETT263_TWIST_ON_NO_BM
#define FETT263_THRUST_ON
#define FETT263_TWIST_OFF
#define FETT263_FORCE_PUSH
#define FETT263_FORCE_PUSH_LENGTH 5
#endif

#ifdef CONFIG_PROP
#include "../props/saber_fett263_buttons.h"
#endif


#ifdef CONFIG_PRESETS

Preset presets[] = {
{ "rey;common",  "font0/tracks/scavenger.wav",
/* copyright Fett263 Simple (Accent LED / PCB) OS6 Style
https://fett263.com/fett263-proffieOS6-style-library.html#Simple
OS6.7 v4.021
This Style Contains 12 Unique Combinations
Style Options:
Default (0): AudioFlicker (Single Color (75%))
1: AudioFlicker (Single Color (50%))
2: Static

Off Behavior: Off

Base Color: Rgb<180,130,0> (0)

--Effects Included--
Preon Effect: Sparking (PreOn Color)
Ignition Effect Options: Default (0): SparkTip Ignition, 1: Standard Ignition
Retraction Effect: Instant
CoolDown Effect Options: Default (0): Unstable Cool Down Forward, 1: Disable
Lockup Effect: Intensity Lockup Up V1
Blast Effect: Blast Wave Up (Sound Based)
Clash Effect: Real Clash V1 Up
*/
StylePtr<Layers<ColorSelect<IntArg<STYLE_OPTION_ARG,0>,TrInstant,AudioFlicker<RgbArg<BASE_COLOR_ARG,Rgb<180,130,0>>,Mix<Int<24576>,Black,RgbArg<BASE_COLOR_ARG,Rgb<180,130,0>>>>,AudioFlicker<RgbArg<BASE_COLOR_ARG,Rgb<180,130,0>>,Mix<Int<16448>,Black,RgbArg<BASE_COLOR_ARG,Rgb<180,130,0>>>>,RgbArg<BASE_COLOR_ARG,Rgb<180,130,0>>>,TransitionEffectL<TrSelect<IntArg<RETRACTION_COOL_DOWN_ARG,0>,TrConcat<TrJoin<TrDelayX<RetractionTime<0>>,TrInstant>,Stripes<3000,-3500,RgbArg<RETRACTION_COLOR_ARG,Rgb<255,255,255>>,RandomPerLEDFlicker<Mix<Int<7710>,Black,RgbArg<RETRACTION_COLOR_ARG,Rgb<255,255,255>>>,Black>,BrownNoiseFlicker<RgbArg<RETRACTION_COLOR_ARG,Rgb<255,255,255>>,Mix<Int<3855>,Black,RgbArg<RETRACTION_COLOR_ARG,Rgb<255,255,255>>>,200>,RandomPerLEDFlicker<Mix<Int<3137>,Black,RgbArg<RETRACTION_COLOR_ARG,Rgb<255,255,255>>>,Mix<Int<3855>,Black,RgbArg<RETRACTION_COLOR_ARG,Rgb<255,255,255>>>>>,TrFade<800>>,TrInstant>,EFFECT_RETRACTION>,TransitionEffectL<TrWaveX<RgbArg<BLAST_COLOR_ARG,Rgb<255,255,255>>,Scale<WavLen<>,Int<100>,Int<400>>,Int<100>,Scale<WavLen<>,Int<100>,Int<400>>,Int<0>>,EFFECT_BLAST>,Mix<IsLessThan<ClashImpactF<>,Int<26000>>,TransitionEffectL<TrWaveX<RgbArg<CLASH_COLOR_ARG,Rgb<255,255,255>>,Scale<ClashImpactF<>,Int<100>,Int<400>>,Int<100>,Scale<ClashImpactF<>,Int<100>,Int<400>>,Int<0>>,EFFECT_CLASH>,AlphaL<White,Int<0>>>,TransitionEffectL<TrConcat<TrInstant,AlphaL<RgbArg<LOCKUP_COLOR_ARG,Rgb<255,255,255>>,SmoothStep<ClashImpactF<>,Int<-4000>>>,TrFadeX<Scale<ClashImpactF<>,Int<100>,Int<300>>>>,EFFECT_LOCKUP_BEGIN>,TransitionEffectL<TrConcat<TrInstant,AlphaL<RgbArg<LOCKUP_COLOR_ARG,Rgb<255,255,255>>,Int<0>>,TrSelect<Scale<IsLessThan<ClashImpactF<>,Int<20000>>,Int<1>,Int<0>>,TrWaveX<RgbArg<LOCKUP_COLOR_ARG,Rgb<255,255,255>>,Scale<ClashImpactF<>,Int<50>,Int<400>>,Int<100>,Scale<ClashImpactF<>,Int<500>,Int<300>>,Int<0>>,TrSparkX<Stripes<1200,-3600,Mix<Int<6425>,Black,RgbArg<LOCKUP_COLOR_ARG,Rgb<255,255,255>>>,RgbArg<LOCKUP_COLOR_ARG,Rgb<255,255,255>>,Mix<Int<12850>,Black,RgbArg<LOCKUP_COLOR_ARG,Rgb<255,255,255>>>>,Int<30>,Scale<Sum<ClashImpactF<>,SwingSpeed<600>>,Int<100>,Int<400>>,Int<0>>>>,EFFECT_LOCKUP_END>,InOutTrL<TrSelect<IntArg<IGNITION_OPTION_ARG,0>,TrWipeSparkTipX<RgbArg<IGNITION_COLOR_ARG,Rgb<255,255,255>>,IgnitionTime<500>>,TrWipeX<IgnitionTime<500>>>,TrInstant,Black>,TransitionEffectL<TrConcat<TrInstant,AlphaL<BrownNoiseFlickerL<RgbArg<PREON_COLOR_ARG,Rgb<255,255,255>>,Int<30>>,SmoothStep<Scale<SlowNoise<Int<2000>>,IntArg<PREON_SIZE_ARG,32768>,Sum<IntArg<PREON_SIZE_ARG,32768>,Int<4000>>>,Int<-2000>>>,TrDelayX<WavLen<EFFECT_PREON>>>,EFFECT_PREON>>>(),

/* copyright Fett263 Simple (Primary Blade) OS6 Style
https://fett263.com/fett263-proffieOS6-style-library.html#Simple
OS6.7 v4.021
This Style Contains 6 Unique Combinations
Style Options:
Default (0): AudioFlicker (Single Color (75%))
1: AudioFlicker (Single Color (50%))
2: Static

Base Color: Rgb<180,130,0> (0)

--Effects Included--
Ignition Effect Options: Default (0): SparkTip Ignition, 1: 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,AudioFlicker<RgbArg<BASE_COLOR_ARG,Rgb<180,130,0>>,Mix<Int<24576>,Black,RgbArg<BASE_COLOR_ARG,Rgb<180,130,0>>>>,AudioFlicker<RgbArg<BASE_COLOR_ARG,Rgb<180,130,0>>,Mix<Int<16448>,Black,RgbArg<BASE_COLOR_ARG,Rgb<180,130,0>>>>,RgbArg<BASE_COLOR_ARG,Rgb<180,130,0>>>,TransitionEffectL<TrWaveX<RgbArg<BLAST_COLOR_ARG,Rgb<255,255,255>>,Scale<EffectRandomF<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,255,255>>,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,255,255>>,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,255,255>>,Int<200>>,StripesX<Int<1800>,Scale<NoisySoundLevel,Int<-3500>,Int<-5000>>,Mix<Int<6425>,Black,RgbArg<LOCKUP_COLOR_ARG,Rgb<255,255,255>>>,RgbArg<LOCKUP_COLOR_ARG,Rgb<255,255,255>>,Mix<Int<12850>,Black,RgbArg<LOCKUP_COLOR_ARG,Rgb<255,255,255>>>>>,AlphaL<AudioFlicker<RgbArg<LOCKUP_COLOR_ARG,Rgb<255,255,255>>,Mix<Int<10280>,Black,RgbArg<LOCKUP_COLOR_ARG,Rgb<255,255,255>>>>,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,255,255>>,AlphaL<RgbArg<LOCKUP_COLOR_ARG,Rgb<255,255,255>>,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,255,255>>,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<TrSelect<IntArg<IGNITION_OPTION_ARG,0>,TrWipeSparkTipX<RgbArg<IGNITION_COLOR_ARG,Rgb<255,255,255>>,IgnitionTime<400>>,TrWipeX<IgnitionTime<400>>>,TrWipeInX<RetractionTime<0>>,Black>>>(),

"rey"
},

};

BladeConfig blades[] = {
{0,SubBlade (0,4 WS281XBladePtr>145,bladepin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3>>() ),
SubBlade (5,145, NULL),
CONFIGARRAY(presets)},
};

#endif

#ifdef CONFIG_BUTTONS
Button PowerButton(BUTTON_POWER, powerButtonPin, "pow");
#endif

 /* Generated with Fett263 Config Helper v3.0 */

Try replacing the > with <
If that doesn’t help, post the error message.

1 Like

that appears to be the culprit there, now I’m getting this error:

C:\Users\tomti\OneDrive\Desktop\7.8x\ProffieOS\config\wilkrey_config.h:107:17: error: too few arguments to function 'BladeBase* SubBlade(int, int, BladeBase*)'
  107 | {0,SubBlade (0,4) WS281XBladePtr<145,bladepin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3>>() ),
      |                 ^
In file included from C:\Users\tomti\OneDrive\Desktop\7.8x\ProffieOS\ProffieOS.ino:600:
C:\Users\tomti\OneDrive\Desktop\7.8x\ProffieOS\blades\sub_blade.h:156:18: note: declared here
  156 | class BladeBase* SubBlade(int first_led, int last_led, BladeBase* blade) {
      |                  ^~~~~~~~
In file included from C:\Users\tomti\OneDrive\Desktop\7.8x\ProffieOS\ProffieOS.ino:634:
C:\Users\tomti\OneDrive\Desktop\7.8x\ProffieOS\config\wilkrey_config.h:107:19: error: expected '}' before 'WS281XBladePtr'
  107 | {0,SubBlade (0,4) WS281XBladePtr<145,bladepin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3>>() ),
      | ~                 ^~~~~~~~~~~~~~
C:\Users\tomti\OneDrive\Desktop\7.8x\ProffieOS\config\wilkrey_config.h:107:19: error: expected '}' before 'WS281XBladePtr'
C:\Users\tomti\OneDrive\Desktop\7.8x\ProffieOS\config\wilkrey_config.h:106:24: note: to match this '{'
  106 | BladeConfig blades[] = {
      |                        ^
C:\Users\tomti\OneDrive\Desktop\7.8x\ProffieOS\config\wilkrey_config.h:109:21: error: expected declaration before '}' token
  109 | CONFIGARRAY(presets)},
      |                     ^
C:\Users\tomti\OneDrive\Desktop\7.8x\ProffieOS\config\wilkrey_config.h:109:22: error: expected unqualified-id before ',' token
  109 | CONFIGARRAY(presets)},
      |                      ^
C:\Users\tomti\OneDrive\Desktop\7.8x\ProffieOS\config\wilkrey_config.h:110:1: error: expected unqualified-id before '}' token
  110 | };
      | ^
C:\Users\tomti\OneDrive\Desktop\7.8x\ProffieOS\config\wilkrey_config.h:110:1: error: expected declaration before '}' token

exit status 1

Compilation error: too few arguments to function 'BladeBase* SubBlade(int, int, BladeBase*)'

You also need a comma between 4 and WS281XBlade

1 Like

that was it, and calitalize P in bladePin! Thanks Fredrik!!

did you mean caPitalize? LOL.

1 Like

see my problem when I handtype subblades??, Its why I still dislike them, but I think I just need more in my repository so I can cut and paste!

1 Like

New problem but related to subblade syntax error. I was able to get my config compiled, and uploaded; however, once uploaded, I got spoken message, “Error in Blade Array”.

BladeConfig blades[] = {
{0,SubBlade (0,4, WS281XBladePtr<145,bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3>>() ),
SubBlade (5,145, NULL),
CONFIGARRAY(presets)},
};

Since you have 145 pixels, they are numbered 0 ~ 144. So change the 2nd SubBlade to “5,144” like so:

BladeConfig blades[] = {
{0,SubBlade (0,4, WS281XBladePtr<145,bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3>>() ),
SubBlade (5,144, NULL),
CONFIGARRAY(presets)},
};
1 Like

I’m just not good with subblades but thank you Fernando, I basically hand copied this from Dmitry’s manual. I did try your config helper too. TY!!!

You’re welcome, yeah you just need to keep in mind the last pixel will always be one less than the length since they start at 0. Then it’s pretty straightforward, the first SubBlade defines the blade type as you would a normal blade, just with the led #s, all subsequent just have the led #s and NULL.

So if you had a normal blade like this:

{ 0, WS281XBladePtr<144, bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3> >(), CONFIGARRAY(presets) },
};

The blade definition is:

WS281XBladePtr<144, bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3> >()

To split into SubBlades you first wrap the blade definition in SubBlade(starting pixel, ending pixel, blade definition) :

SubBlade(0, 4, blade definition)

Then additional blades are just:

SubBlade(starting pixel, ending pixel, NULL)

Keeping in mind last pixel is one less than your length.

And then account for each SubBlade in the NUM_BLADES and styles per preset.

Just one thing, you have 145 pixels so you may want to bump up maxLedsPerStrip to 145, its only 1 pixel but anytime a blade is more than 144 you want to account for it in maxLedsPerStrip at top of config as well.

2 Likes