Proffie code error - Arduino

I’m sure this is a stupid thing I’m missing but I replaced one part of my code with one from somebody who claims to have fixed the blinkies on The Pach Store Luke and now my code is throwing error codes when I verify it in Arduino. Can anyone see the issue? I’m still learning.

Arduino: 1.8.19 (Mac OS X), TD: 1.57, Board: “Proffieboard V2, Serial + WebUSB, SDCARD (SPI), 80 MHz, Smallest Code”

In file included from /Users/ChrisBodall/Chris’s Stuff/Sabers/ProffieOS/ProffieOS.ino:563:
/Users/ChrisBodall/Chris’s Stuff/Sabers/ProffieOS/config/TPS.h:173:1: error: too many initializers for ‘Preset’
173 | };
| ^
exit status 1
Error compiling for board Proffieboard V2.

This report would have more information with
“Show verbose output during compilation”
option enabled in File → Preferences.

And now I’m getting this. Changed some things to try to figure it out but changed everything back…

Arduino: 1.8.19 (Mac OS X), TD: 1.57, Board: “Proffieboard V2, Serial + WebUSB, SDCARD (SPI), 80 MHz, Smallest Code”

In file included from /Users/ChrisBodall/Chris’s Stuff/Sabers/ProffieOS/ProffieOS.ino:563:
/Users/ChrisBodall/Chris’s Stuff/Sabers/ProffieOS/config/TPS.h:173:2: error: expected ‘}’ before ‘;’ token
173 | };
| ^
In file included from /Users/ChrisBodall/Chris’s Stuff/Sabers/ProffieOS/ProffieOS.ino:563:
/Users/ChrisBodall/Chris’s Stuff/Sabers/ProffieOS/config/TPS.h:47:20: note: to match this ‘{’
47 | Preset presets[] = {
| ^
In file included from /Users/ChrisBodall/Chris’s Stuff/Sabers/ProffieOS/ProffieOS.ino:563:
/Users/ChrisBodall/Chris’s Stuff/Sabers/ProffieOS/config/TPS.h:173:2: error: too many initializers for ‘Preset’
173 | };
| ^
exit status 1
Error compiling for board Proffieboard V2.

This report would have more information with
“Show verbose output during compilation”
option enabled in File → Preferences.

The “LukeCave” preset seems to have three styles in it, but NUM_BLADES is 1, so it should only have one style, not three.

It has 3 because the other 2 are for accent LEDs on the hilt. What line do I have to change the blade number to 3?

If that’s the case, then you should have the 2 blade styles for the accent LEDs in every preset, so that they ALL have 3.
However, your BladeConfig is not setup for any accent LEDs in the hilt. It only has 1 main blade. Where is this config from?
Did you make it yourself?
Was it provided with a purchased saber?
Who wired the board?

Bottom line is you need to have the BladeConfig setup for how many blades you have based on how the board is wired. That will determine how many blades you actually have.
Then you set #define NUM_BLADES, to that number, and put that many styles per preset (one style for each blade).

I only want the accent LEDs on that one preset.

The config is something that was initially generated by Fett263’s configurator but I’ve been modifying it to meet my needs.

The Luke cave preset came from someone on FB who said they figured out accent LEDs for The Pach Store’s Luke Hero. Ever since I starting using a custom config instead of the stock Pach Store config the accent LEDs aren’t right. The board was installed by The Pach Store.

I changed the blade number to 3. Overlooking that was a noob mistake.

Edit: changing the blade number to 3 is giving me more and different errors.

I changed the blade number to 3 and pasted the other 2 lines into the rest of the presets so they all have 3 styles now. This is what Arduino says… maybe the code I was given is bad?

Arduino: 1.8.19 (Mac OS X), TD: 1.57, Board: “Proffieboard V2, Serial + WebUSB, SDCARD (SPI), 80 MHz, Smallest Code”

In file included from /Users/ChrisBodall/Chris’s Stuff/Sabers/ProffieOS/ProffieOS.ino:563:
/Users/ChrisBodall/Chris’s Stuff/Sabers/ProffieOS/config/TPS.h:179:1: error: expected ‘}’ before ‘StylePtr’
179 | StylePtr<Layers<Green,LockupTrL<AudioFlickerL,TrInstant,TrFade<500>,SaberBase::LOCKUP_NORMAL>,LockupTrL<AudioFlickerL,TrInstant,TrFade<500>,SaberBase::LOCKUP_LIGHTNING_BLOCK>,TransitionEffectL<TrConcat<TrInstant,White,TrFade<400>>,EFFECT_CLASH>,InOutTrL<TrInstant,TrInstant,TransitionLoop<Green,TrConcat<TrBoing<3000,9>,Black,TrDelay<2000>>>>>>(),
| ^~~~~~~~
In file included from /Users/ChrisBodall/Chris’s Stuff/Sabers/ProffieOS/ProffieOS.ino:563:
/Users/ChrisBodall/Chris’s Stuff/Sabers/ProffieOS/config/TPS.h:177:4: note: to match this ‘{’
177 | { “Newtype;common”, “tracks/MobileSuit.wav”,
| ^
In file included from /Users/ChrisBodall/Chris’s Stuff/Sabers/ProffieOS/ProffieOS.ino:563:
/Users/ChrisBodall/Chris’s Stuff/Sabers/ProffieOS/config/TPS.h:179:1: error: expected ‘}’ before ‘StylePtr’
179 | StylePtr<Layers<Green,LockupTrL<AudioFlickerL,TrInstant,TrFade<500>,SaberBase::LOCKUP_NORMAL>,LockupTrL<AudioFlickerL,TrInstant,TrFade<500>,SaberBase::LOCKUP_LIGHTNING_BLOCK>,TransitionEffectL<TrConcat<TrInstant,White,TrFade<400>>,EFFECT_CLASH>,InOutTrL<TrInstant,TrInstant,TransitionLoop<Green,TrConcat<TrBoing<3000,9>,Black,TrDelay<2000>>>>>>(),
| ^~~~~~~~
In file included from /Users/ChrisBodall/Chris’s Stuff/Sabers/ProffieOS/ProffieOS.ino:563:
/Users/ChrisBodall/Chris’s Stuff/Sabers/ProffieOS/config/TPS.h:47:20: note: to match this ‘{’
47 | Preset presets[] = {
| ^
In file included from /Users/ChrisBodall/Chris’s Stuff/Sabers/ProffieOS/ProffieOS.ino:563:
/Users/ChrisBodall/Chris’s Stuff/Sabers/ProffieOS/config/TPS.h:179:1: error: expected ‘,’ or ‘;’ before ‘StylePtr’
179 | StylePtr<Layers<Green,LockupTrL<AudioFlickerL,TrInstant,TrFade<500>,SaberBase::LOCKUP_NORMAL>,LockupTrL<AudioFlickerL,TrInstant,TrFade<500>,SaberBase::LOCKUP_LIGHTNING_BLOCK>,TransitionEffectL<TrConcat<TrInstant,White,TrFade<400>>,EFFECT_CLASH>,InOutTrL<TrInstant,TrInstant,TransitionLoop<Green,TrConcat<TrBoing<3000,9>,Black,TrDelay<2000>>>>>>(),
| ^~~~~~~~
/Users/ChrisBodall/Chris’s Stuff/Sabers/ProffieOS/config/TPS.h:183:1: error: expected declaration before ‘}’ token
183 | };
| ^
In file included from /Users/ChrisBodall/Chris’s Stuff/Sabers/ProffieOS/ProffieOS.ino:537:
/Users/ChrisBodall/Chris’s Stuff/Sabers/ProffieOS/config/TPS.h:185:109: error: cannot convert ‘Preset*’ to ‘BladeBase*’ in initialization
185 | { 0, WS281XBladePtr<133, bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3> >(), CONFIGARRAY(presets) },
| ^~~~~~~
| |
| Preset*
/Users/ChrisBodall/Chris’s Stuff/Sabers/ProffieOS/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 ‘BladeBase*’ [-fpermissive]
299 | #define NELEM(X) (sizeof(X)/sizeof((X)[0]))
| ^~~~~~
| |
| unsigned int
/Users/ChrisBodall/Chris’s Stuff/Sabers/ProffieOS/common/preset.h:6:27: note: in expansion of macro ‘NELEM’
6 | #define CONFIGARRAY(X) X, NELEM(X)
| ^~~~~
/Users/ChrisBodall/Chris’s Stuff/Sabers/ProffieOS/config/TPS.h:185:97: note: in expansion of macro ‘CONFIGARRAY’
185 | { 0, WS281XBladePtr<133, bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3> >(), CONFIGARRAY(presets) },
| ^~~~~~~~~~~
exit status 1
invalid conversion from ‘unsigned int’ to ‘BladeBase*’ [-fpermissive]

This report would have more information with
“Show verbose output during compilation”
option enabled in File → Preferences.

You still need to provide a style in each preset, just leave blank in the Tool and it wiil set to Black as long as you enter a BladeConfig with 3 blades in it.

Make the edits in the Tool, it ensures the syntax is correct :wink:

I was trying to activate volume control from memory and I messed up. With the blade on, I held aux and clicked power and it made a sound I didn’t recognize and the blade light turned off. I checked your prop file to see what I did. Is that power lock? The blade was facing up but don’t think it was straight up. How do I get the blade back on? Can’t figure it out. Thanks.

Depends on which OS version and the defines you have running, but nothing I can think of would turn the blade off. What happens when you reboot the saber or change presets?
Post your config and let me know the OS version so we can narrow down. Also, probably a good idea to review the controls, the Volume Menu only runs while the blade is OFF :wink:

OS 7. If I reboot saber, blade is still off for that font. All other fonts work normally.

I wonder if you triggered Change Style. Delete presets.ini and presets.tmp on your SD card and see if that fixes. If it does I’d recommend reviewing the controls and/or using the config tool with OS7 selected and disable features you don’t intend to use, like Change Style, etc to prevent a future mishap :wink:

That did it. Thanks. If I want to disable change style and color change outside of edit mode, what’s the easiest way to do that to an existing config?