Blade config

The # is definitely missing. I looked back at the other pastebins I posted. I can’t wait now to get back to fix. Good eye!!!
I’m guessing I have accidentally deleted at some point in the last few months.

the “#” is there. I just failed to copy and paste it correctly.

If it’s still not working, post the config you’re using AND the error you’re getting and we’ll have another look.

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 | };
| ^
sketch/config/myos6_config.h:264:70: error: cannot convert ‘BladeBase*’ to ‘Preset*’ in initialization
264 | WS281XBladePtr<6, blade2Pin, Color8::GRB, PowerPINS >()
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
| |
| 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]

I copied and pasted the blade config straight from FETT263 website. It doesn’t like 1 blade for some reason.

This preset still has two styles in it:

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

You need to remove it or change it to:

{ "Battery", "Tracks/venus.wav",
&style_charging, "Battery\nLevel"},
1 Like

It’s fixed!! I changed the battery preset as you said, and I changed the bladeconfig by removing that second part.

Thank you again!

It is actually not fixed, but I’m going to give up for the moment. The file compiled, but when I uploaded it to the board, the blade will not ignite. I’m going back to the way it was, because it worked fine. “Why fix what ain’t broke.” Right? I just thought I could correct the code. I’ll come back to it later when I learn more. I will not be able to change my blade lengthy in edit mode, but that isn’t a big deal at the moment.

The sample config? That is just a “sample” hence the note at the top of the page. If your saber isn’t wired the same as the sample is it won’t work. You need to keep the BladeConfig section that came with your saber intact, it specifies what “pins” your blade/connector is actually wired to.

Yeah. I did some reading last night, and learned what you just said. I also realized I forgot to add the shared pin define when I switch over to os6. My blade connectors had LEDs on them. Well 3 out of the 4. I put that define back in, and I still get errors when I switch to 1 blade instead of 2. I’ll keep playing with it. It will help me continue to grow. I have the saber building bug now, and I want to get better.

OK, the number of blades has to be the same in

number of styles per preset

So if you have NUM_BLADES = 1, then there can only be 1 style per preset and only 1 blade set up in the BladeConfig blades[] at bottom. Any discrepancy between these will cause errors.

Here is the current config that works with 2 blades selected.

To convert it to a single blade, change NUM_BLADES to one, remove the second style in each preset and remove the second blade in the blade config.
(don’t change anything else, at least for now)

If that doesn’t work, post the result, and the error message and we’ll take a look.

That worked. It compiled, and the blade ignites like it is supposed to. Thank you!!

Sorry that took so long for me to clue in. I followed your advise on this earlier in the conversation, but I was using the “sample” blade config I had pulled of the fett263 website. It didn’t dawn on me I just needed to alter my existing blade config.