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.
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.
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.
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.
{ "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…
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.