Compilation error: too many initializers for ‘Preset’

Hi there. I’ve solved a bunch of headaches in the last few days and it’s been a bit of a learning curve, but I’m now appealing for help as this last thing has me stumped. One of the latest things throwing up errors was that my config file provided by 89sabers was set up for 3 blades, not 1. Having sorted that issue, I have one that perseveres which is [Compilation error: too many initializers for ‘Preset’].

I’ve seen this issue solved in different threads, but unfortunately the solution wasn’t relevant to me.

Here’s my config: #ifdef CONFIG_TOP#include "proffieboard_v3_config.h"#define NUM_BLADES 1#d - Pastebin.com

Thanks in advance,

Rhod

well, how many blades do you have 1 or 3 ? Num blades, Preset presets[] = & BladeConfig blades[] = must all point to the same number. You have two preset with 3 blades, the rest is all 1:

"Fire;MC"
&
"Power;MC"

Have 3 blade styles

1 Like

Thanks so much for pointing this out. So if I’m understanding correctly, I’d change

{ “Fire;MC”, “tracks/Fire.wav”,
StyleFirePtr<Red, Yellow>(),
StyleFirePtr<Red, Yellow>(),
StyleFirePtr<Red, Yellow>(), “0”},

to

{ “Fire;MC”, “tracks/Fire.wav”,
StyleFirePtr<Red, Yellow>(), “0”},

Is that right?

Really appreciate you pointing it out. I was looking for the number 3 or something rather than repeated lines. Shows how little I still know!

that is correct and same for the other one

1 Like

Thanks so much for your help!

1 Like

Just flashed the unit and everything works great - except the proffie itself no longer lights up :rofl:

(I’m talking about the light that shines from under the pin connectors in the selected colour, not the green indicator light). I assume most proffies have this?

Not important. I only need lights on the hilt/blade, but I’m dumbfounded why that would suddenly be broken. If anyone can give an explanation/fix, I’d love to learn what’s changed.

Do you have the original/unmodified config. I guess you do have 3 blades after all. A blade under ProffieOS is anything that lights up (or spins - like a motor). So since your config doesn’t declare the hilt side connector as a blade, it won’t light up either (the hilt side is usually 2 blades on its own - inner & outer ring).

The presets don’t matter here, just post the BladeConfig blades[] = { section. Please use the 3 back ticks method like this:

```
your code here
```

This is from the original 3 blade config before I modified it.


BladeConfig blades[] = {
  { 0, WS281XBladePtr<128, bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3> >(),
    WS281XBladePtr<26, blade2Pin, Color8::GRB, PowerPINS<bladePowerPin1> >(),
    WS281XBladePtr<26, blade3Pin, Color8::GRB, PowerPINS<bladePowerPin4> >()
  , CONFIGARRAY(presets) },
};


Interestingly, 89sabers also sent me a different config file when I made an enquiry, and that was a 2 blade one…I never used it though so can’t comment on what effect that might have had. They said it was the one intended for my hilt, whereas the one I ended up using was in a text document on the sd card.

Also, not sure if this throws a spanner in your theory, but the emitter lights on the hilt work fine. It’s purely the lights that shine out of the top of the proffie itself that have stopped working.

My guess those might be accent leds ? The blade config you posted above has 3 blades, all connected to a different “pin”. Proffieboard doesn’t know what is connected and only send a signal to where you say a " blade" is connected. So if you have more blades connected (2 or 3) to a different pin, you need to declare that in your config: num blade 2, 2 blades in bladeconfig & 2 blade styles in each preset. They all need to match. Same for 3 “blades”. If you miss one somewhere, you’ll get a compile error. If you “forget” a blade “equally”, something won’t light-up.

I am not an English speaker, so I’m not sure what I said is clear ? If you declare num blade = 2, you need 2 blades and 2 blade styles per presets (not 1 or 3, just exactly 2 everywhere). But if you “physicly” have 3 blades but only declared 2, then one won’t lightup.

I’m not good at interpreting the different blade profiles, but I’m just curious if you could tell me if this one is a single blade or a multi-blade one? This was one of the originals that was working fine before I altered the NUM_BLADES entry:

{ "ObiWan4;MC", "tracks/ObiWan4.wav",
     StylePtr<InOutHelper<OnSpark<Blast<LocalizedClash<Lockup<AudioFlicker<Blue,DodgerBlue>,Pulsing<Gradient<AudioFlicker<Blue,DodgerBlue>,AudioFlicker<Blue,DodgerBlue>,HumpFlicker<OrangeRed,Pink,50>,AudioFlicker<Blue,DodgerBlue>,AudioFlicker<Blue,DodgerBlue>>,Gradient<AudioFlicker<Blue,DodgerBlue>,AudioFlicker<Blue,DodgerBlue>,HumpFlicker<OrangeRed,Pink,50>,AudioFlicker<Blue,DodgerBlue>,AudioFlicker<Blue,DodgerBlue>,AudioFlicker<Blue,DodgerBlue>>,3500>,Gradient<AudioFlicker<Blue,DodgerBlue>,AudioFlicker<Blue,DodgerBlue>,HumpFlicker<Pink,OrangeRed,50>>>,Pink>,Pink>,Pink,400>,200,500>>(),   
     StylePtr<InOutHelper<OnSpark<Blast<LocalizedClash<Lockup<AudioFlicker<Blue,DodgerBlue>,Pulsing<Gradient<AudioFlicker<Blue,DodgerBlue>,AudioFlicker<Blue,DodgerBlue>,HumpFlicker<OrangeRed,Pink,50>,AudioFlicker<Blue,DodgerBlue>,AudioFlicker<Blue,DodgerBlue>>,Gradient<AudioFlicker<Blue,DodgerBlue>,AudioFlicker<Blue,DodgerBlue>,HumpFlicker<OrangeRed,Pink,50>,AudioFlicker<Blue,DodgerBlue>,AudioFlicker<Blue,DodgerBlue>,AudioFlicker<Blue,DodgerBlue>>,3500>,Gradient<AudioFlicker<Blue,DodgerBlue>,AudioFlicker<Blue,DodgerBlue>,HumpFlicker<Pink,OrangeRed,50>>>,Pink>,Pink>,Pink,400>,200,500>>(),   
     StylePtr<InOutHelper<OnSpark<Blast<LocalizedClash<Lockup<AudioFlicker<Blue,DodgerBlue>,Pulsing<Gradient<AudioFlicker<Blue,DodgerBlue>,AudioFlicker<Blue,DodgerBlue>,HumpFlicker<OrangeRed,Pink,50>,AudioFlicker<Blue,DodgerBlue>,AudioFlicker<Blue,DodgerBlue>>,Gradient<AudioFlicker<Blue,DodgerBlue>,AudioFlicker<Blue,DodgerBlue>,HumpFlicker<OrangeRed,Pink,50>,AudioFlicker<Blue,DodgerBlue>,AudioFlicker<Blue,DodgerBlue>,AudioFlicker<Blue,DodgerBlue>>,3500>,Gradient<AudioFlicker<Blue,DodgerBlue>,AudioFlicker<Blue,DodgerBlue>,HumpFlicker<Pink,OrangeRed,50>>>,Pink>,Pink>,Pink,400>,200,500>>(), "0"},  

That’s 3 blades, right? Though it’s still a mystery to me why I’d still have 2 lights working despite having altered the NUM_BLADES entry down to 1. Your English is fine, I’m just an idiot :rofl:

each line that starts with “StylePtr” is a new blade style for a different blade. They can be identical or different, for example, if you have a green and red arrow led on your control box, you want them to be different so they can blink in a different pattern.

Nope, you’re not, this is basic stuff but it is just complicated to get the gist of it. I was a ProffieOS newbie just a year ago. I think you’re picking it up quite fast.

Edit: reading through the POD (Proffie OS Documentation) helps to learn faster.

2 Likes

I suspect that my saber is actually a 2 bladed one. One is on the proffie, and the other is the emitter lights and the blade sharing the same pins. Just a hunch. Also the fact 89sabers sent me a 2 bladed config supports this.

I COULD test that theory, set NUM_BLADES to 2 and give every blade style 2 entries, but it seems unnecessary just to enable a light that I won’t even see most of the time.

Thanks for the help though. This noob is very grateful.

If you do declare 2 blades, just make sure you know the right pin number for the second blade.

We all start as noobs. :grin:

Happy to help.

1 Like

Depending on your kind of hilt those extra blades could be something like, the light-up buttons, crystals chambers, light strips on the chassis, ect.

You can save yourself some effort & check at the bottom how many pixels are programmed for each blade at the bottom to give you an idea of how complex the BladeConfig needs to be. If it’s a button it generally doesn’t matter what color you use because it’s programmed with just a single pixel that usually just a single LED color so it will come out the same color no matter what you program it. You can always program them to pulse or flash, ect. though…