Error: Cannot convert ‘const char*’ to “StyleFactory*’ in initialization

I’ve been looking around and haven’t found an answer that helped me, so I’m hoping someone can help me here.

Finally decided to try adding a Greyscale Font to my new Sabertrio Proffie Saber. It’s a Proffieboard v3.9 with S3’s Preconfiguration 4.2

I used Greyscale’s custom bladestyle code for the Engine Grip font, went to verify everything in Arduino, and got this error message:

In file included from D:\extra\ProffieOS\ProffieOS.ino:627:
D:\extra\ProffieOS\config\s3config_v3.h:1045:3: error: cannot convert ‘const char*’ to ‘StyleFactory*’ in initialization
1045 | “Engine Grip”
| ^~~~~~~~~~~~~
| |
| const char*

exit status 1

Compilation error: cannot convert ‘const char*’ to ‘StyleFactory*’ in initialization

I should mention that I am a complete novice when it comes to this stuff, so please provide as much detail as possible if you have an answer. Please explain it to me like I’m dumb because I probably am.

This is my full config with Engine Grip as the last style:

yeP6Bk6c.txt (89.8 KB)

Your config file is Long™, so I didn’t read it in detail.

Normally, this problem happens because one or more of your presets don’t have enough styles in them. Since you have two blades (NUM_BLADES is 2), you need two styles in each of your presets. I’m guessing some of them only have one, and that is what causes this error.

The second “blade” looks like it only has one LED, so I’m guessing it’s a crystal chamber or button LED or something.

A lot of times, just copying the same style twice is an easy way to resolve an issue like this. Or, you can copy the second style from some other preset.

Yeah unfortunately the Greyscale Font bladestyles are very long.

So yes, the second blade is in reference to the activation switch LED. I copied the appropriate style from another font and changed the color code to match.

Now however, when I verified the sketch it simply said “done compiling” and nothing else. And when uploading to the board, it gave me the error code “failed uploading exit status 255”

My computer recognized my board as “STM32 BOOTLOADER” but when I ejected it and plugged it back in, it recognized it properly as Proffieboard.

Soooooo…what gives??

I’m not sure what’s going on, I’d need to see the whole output, not just the last line to know…

Maybe it worked?

This page shows what it’s supposed to look like (and some common errors):

Sometimes the uploads work just fine, but then an error occurs during the reset after the upload. Such errors can generally be ignored.

It did not work.

The board is flashing, but it does not recognize the new font; it only recognizes the other preloaded ones.

Really it seems more like it’s flashing the original configuration and ignoring any changes made. very strange

Well, there are a number of things that can cause that.

The most common one: It didn’t actually upload.
Did you see the 0-100% progress bar? Did it finish?
Or did you just see a 0-10 count?

The page I linked earlier shows exactly what it’s supposed to look like, so hopefully that is not actually the problem here.

Second problem is using KEEP_SAVEFILES_WHEN_PROGRAMMING. I see that you have that in your config file, but it’s commented out, so hopefully that isn’t the issue either…

Next up is compiling the wrong thing. Arduino doesn’t really tell you what directory you’re in, and it can be easy to get confused, editing files in one directory and then uploading files from another. Normally the way to check is to insert something that will cause a failure in the config file and then hit upload, if it works, then clearly you have the wrong file. Of course, that’s exactly what happened earlier, so if you were able to fix the problem you had in the top post, then you and Arduino should agree on what files are being used.

This is where I get a bit confused, because I can’t think of any other reason for upload to seemingly work, but not actually take effect…

I am also very confused.

Eventually I did get the font to upload properly. But then I tried again with a second one and it didn’t register, so I have no idea what I’m doing wrong.

I also have a Proffie v2.2 and I didn’t have nearly as much trouble flashing the board with that one. Ugh!

{ Engine;common, commontracksvenus…txt (5.4 KB)

here it is tided up to make it look a lot neater

I recommend using pastebin.com to post your full config, it makes it much easier for people to review.

Layered is easier to read IMO

{ "Engine;common", "common/tracks/venus.wav",
StylePtr<Layers<
  Stripes<3000,-2400,RgbArg<BASE_COLOR_ARG,Green>,Mix<Int<4000>,Black,RgbArg<BASE_COLOR_ARG,Green>>,RgbArg<BASE_COLOR_ARG,Green>,Mix<Int<12000>,Black,RgbArg<BASE_COLOR_ARG,Green>>>,
  TransitionLoopL<TrConcat<TrDelayX<Scale<SlowNoise<Int<1000>>,Int<300>,Int<3000>>>,AlphaL<RgbArg<EMITTER_COLOR_ARG,Rgb<100,100,150>>,Int<0>>,TrSparkX<RgbArg<EMITTER_COLOR_ARG,Rgb<100,100,150>>,Scale<NoisySoundLevel,Int<200>,Int<600>>,Int<250>,Int<0>>>>,
  TransitionEffectL<TrConcat<TrJoin<TrDelayX<IgnitionTime<>>,TrInstant>,Stripes<5000,2500,RgbArg<IGNITION_COLOR_ARG,Rgb<100,100,150>>,Mix<Int<7710>,Black,RgbArg<IGNITION_COLOR_ARG,Rgb<100,100,150>>>,Mix<Int<3855>,Black,RgbArg<IGNITION_COLOR_ARG,Rgb<100,100,150>>>>,TrFade<800>>,EFFECT_IGNITION>,
  TransitionEffectL<TrWaveX<RgbArg<BLAST_COLOR_ARG,White>,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,White>,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,White>,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,White>,Int<200>>,StripesX<Int<1800>,Scale<NoisySoundLevel,Int<-3500>,Int<-5000>>,Mix<Int<6425>,Black,RgbArg<LOCKUP_COLOR_ARG,White>>,RgbArg<LOCKUP_COLOR_ARG,White>,Mix<Int<12850>,Black,RgbArg<LOCKUP_COLOR_ARG,White>>>>,AlphaL<AudioFlicker<RgbArg<LOCKUP_COLOR_ARG,White>,Mix<Int<10280>,Black,RgbArg<LOCKUP_COLOR_ARG,White>>>,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,White>,AlphaL<RgbArg<LOCKUP_COLOR_ARG,White>,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,White>,TrFade<400>>,SaberBase::LOCKUP_NORMAL>,
  ResponsiveLightningBlockL<Strobe<RgbArg<LB_COLOR_ARG,White>,AudioFlicker<RgbArg<LB_COLOR_ARG,White>,Blue>,50,1>,TrConcat<TrInstant,AlphaL<RgbArg<LB_COLOR_ARG,White>,Bump<Int<12000>,Int<18000>>>,TrFade<200>>,TrConcat<TrInstant,HumpFlickerL<AlphaL<RgbArg<LB_COLOR_ARG,White>,Int<16000>>,30>,TrSmoothFade<600>>>,
  LockupTrL<AlphaL<RandomPerLEDFlickerL<RgbArg<DRAG_COLOR_ARG,White>>,SmoothStep<IntArg<DRAG_SIZE_ARG,28000>,Int<3000>>>,TrConcat<TrJoin<TrDelay<4000>,TrWipeIn<200>>,AlphaL<BrownNoiseFlickerL<RgbArg<DRAG_COLOR_ARG,White>,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,MoltenCore>,RotateColorsX<Int<3000>,RgbArg<STAB_COLOR_ARG,MoltenCore>>>,Mix<TwistAngle<>,RotateColorsX<Int<3000>,RgbArg<STAB_COLOR_ARG,MoltenCore>>,RotateColorsX<Int<3000>,Mix<Int<12000>,Black,RgbArg<STAB_COLOR_ARG,MoltenCore>>>>,0,3,5,3000,10>>,SmoothStep<IntArg<MELT_SIZE_ARG,28000>,Int<4000>>>,TrConcat<TrWipeIn<100>,AlphaL<RgbArg<STAB_COLOR_ARG,MoltenCore>,SmoothStep<IntArg<MELT_SIZE_ARG,28000>,Int<4000>>>,TrJoin<TrDelay<4000>,TrFade<300>>,AlphaL<Mix<TwistAngle<>,RgbArg<STAB_COLOR_ARG,MoltenCore>,RotateColorsX<Int<3000>,RgbArg<STAB_COLOR_ARG,MoltenCore>>>,SmoothStep<IntArg<MELT_SIZE_ARG,28000>,Int<4000>>>,TrFade<4000>>,TrWipe<200>,SaberBase::LOCKUP_MELT>,
  InOutTrL<TrWipeX<IgnitionTime<>>,TrWipeInX<RetractionTime<>>>,
  TransitionEffectL<TrConcat<TrBoingX<Mult<Int<10922>,WavLen<EFFECT_PREON>>,5>,AlphaL<BrownNoiseFlickerL<RgbArg<BASE_COLOR_ARG,Green>,Int<100>>,SmoothStep<IntArg<PREON_SIZE_ARG,2000>,Int<-4000>>>,TrBoingX<Mult<Int<10922>,WavLen<EFFECT_PREON>>,3>,Black,TrBoingX<Mult<Int<7260>,WavLen<EFFECT_PREON>>,3>,AlphaL<BrownNoiseFlickerL<RgbArg<BASE_COLOR_ARG,Green>,Int<200>>,SmoothStep<Sum<Int<4000>,IntArg<PREON_SIZE_ARG,2000>>,Int<-4000>>>,TrBoingX<Mult<Int<3664>,WavLen<EFFECT_PREON>>,3>>,EFFECT_PREON>>>(),
"Engine"}

Also, that was missing a comma between the end of the style and the “Engine” name argument at the end of the preset.

your right i never noticed that before, still uploads to my board tho without any errors, strange

If the comma is not there, you will get error: expected '}' before string constant

If you omitted the “name” argument completely, it will compile, but you won’t get the helpful error about a NUM_BLADES mismatch, which is the title of this thread.

How do you get it so neat looking?

Looking at my config the comma is present, must of got lost in the copy and paste process not sure how, I like to trim the fat on the style codes, // notes and stuff I know it makes no difference in the memory usage but it just looks better and is more compact, I just posted that style for that font to try make it easier but I think it’s caused more trouble than it is worth

In the Style Editor you can paste, submit, and layerize your styles.

https://fredrik.hubbe.net/lightsaber/style_editor.html

Okay, after sleeping on it, I think I might have my overall solution.

This just goes to show how new to all this I am and the differences between v2.2 and v3.9.

I realized that the config file and sound files on my SD card were not the same as the folder of files on my computer that contained the ProfieOS.ini file from which I was opening Arduino. So, I copied everything over onto my computer and verified the sketch. This time, I noticed the sketch took up more space than before, and no errors occurred, so I hit upload.

My volume and blade length settings were both reset to maximum, so now I have to figure that one out, BUT the second new soundfont registered correctly!