Blade config

I have a new puzzle, and it should be my last. This one is probably much easier to solve.

In my main config, I have 2 blades listed in the top config. However, I only have one blade in all 4 of my sabers. When I built my first saber, I tried to install an LED switch, but I ended up not using it. I never changed my config. Now when I change it to 1 blade and try to compile it, I get errors. Why? Below are the errors. I will also copy and paste the blade config. The bladeconfig is the one I copied and pasted from the FETT 263 website with all the instructions to set up for edit mode. If I change it back to 2 blades, it compiles fine.
Line 261 is the line that starts with the first };

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


In file included from /Users/caseyhorne/Desktop/ProffieOS/ProffieOS.ino:563:
sketch/config/myos6_config.h:261:1: error: too many initializers for 'Preset'
  261 | };
      | ^
sketch/config/myos6_config.h:264:70: error: cannot convert 'BladeBase*' to 'Preset*' in initialization
  264 | WS281XBladePtr<6, blade2Pin, Color8::GRB, PowerPINS<bladePowerPin4> >()
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
      |                                                                      |
      |                                                                      BladeBase*
In file included from /Users/caseyhorne/Desktop/ProffieOS/ProffieOS.ino:537:
sketch/config/myos6_config.h:265:15: error: invalid conversion from 'Preset*' to 'size_t' {aka 'unsigned int'} [-fpermissive]
  265 | , CONFIGARRAY(presets) },
      |               ^~~~~~~
      |               |
      |               Preset*
sketch/common/preset.h:6:24: note: in definition of macro 'CONFIGARRAY'
    6 | #define CONFIGARRAY(X) X, NELEM(X)
      |                        ^
ProffieOS:299:28: error: invalid conversion from 'unsigned int' to 'const char*' [-fpermissive]
  299 | #define NELEM(X) (sizeof(X)/sizeof((X)[0]))
      |                  ~~~~~~~~~~^~~~~~~~~~~~~~~~
      |                            |
      |                            unsigned int
sketch/common/preset.h:6:27: note: in expansion of macro 'NELEM'
    6 | #define CONFIGARRAY(X) X, NELEM(X)
      |                           ^~~~~
sketch/config/myos6_config.h:265:3: note: in expansion of macro 'CONFIGARRAY'
  265 | , CONFIGARRAY(presets) },
      |   ^~~~~~~~~~~
exit status 1
invalid conversion from 'unsigned int' to 'const char*' [-fpermissive]


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

So the first error says that you have too many styles in one or more of your presets, which you didn’t show, so I can’t say where exactly.

I thought you said you changed the number of blades to 1? It still says

#define NUM_BLADES 2

at the top?

yes. sorry. I changed it back before I copied and pasted it into pastebin. It will compile for 2, but it will not for one. I put the one in long enough to get the error, so that I could copy and paste the error here. then I changed it back.

This preset has two styles, maybe that’s why?

{ "Battery", "Tracks/venus.wav",
&style_charging, StyleNormalPtr<CYAN, WHITE, 300, 800>(), "Battery\nLevel"},

interesting. I’ll take it out and see what happens. Why would it work if it is set to 2 blades?

I took that whole style out, compiled it with 1 blade, and I received the exact same error. There is something going on with the blade config that will only allow it to be set to 2 blades.

I don’t mind leaving it just like it is. I just thought maybe there was something simple going on that I can’t see as i’m still very new to coding.

Your bladeconfig is set up for two blades as well, you would need to change it from:

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

to

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

did that. I’m still getting an error, but it is shorter now.
Arduino: 1.8.13 (Mac OS X), Board: “Proffieboard V2, Serial + Mass Storage + WebUSB, SDCARD (SPI), 80 MHz, Smallest Code”

In file included from /Users/caseyhorne/Desktop/ProffieOS/ProffieOS.ino:563:
sketch/config/myos6_config.h:261:1: error: too many initializers for ‘Preset’
261 | };
| ^
exit status 1
Error compiling for board Proffieboard V2.

Show what your config file looks like now.

Because your battery charging preset still has 2 styles.
&style_charging is a style.

I can see what it does when I take that out, but if the second battery style is causing the problem, why would it compile for a 2 blade setup?

I don’t understand the question.

{ "Battery", "Tracks/venus.wav", // font and track
&style_charging,                 // Blade style 1
StyleNormalPtr<CYAN, WHITE, 300, 800>(), // Blade style 2
"Battery\nLevel"},               // preset name

You have 2 blade styles in this preset.
If you only have 1 Blade in the BladeConfig, you need 1 Style per preset for that blade.
If you have 2 blades, you need 2 styles etc…

Each blade needs a style, that’s it.

I can see what Actually, yesterday while working on it. I completely removed the entire battery preset to see if that’s the problem. I did it again just now to double check, and it gives me the exact same error. When I change it back to 2, it works fine.

Actually, yesterday while working on it. I completely removed the entire battery preset to see if that’s the problem. I did it again just now to double check, and it gives me the exact same error. When I change it back to 2, it works fine.

Also, you’re missing the #, the very first character of the file.
The first line should be
#ifdef CONFIG_TOP
You have
ifdef CONFIG_TOP

Very possible. I’ll look at it when I get back home. Had to go out for a couple of hours.

Sorry for the double replies. My phone was glitching for a second.