Help w/ Blade Setup (Proffie Heart - Pach Store Removable Chassis)

I am working on a Proffie Heart from The Pach Store (here). I’ve read everything on BladeID, Blade Detect, as well as a slew of related posts, and have gotten it to a state that I can live with, but not ideal.

Currently, I am not using a Blade Detect Pin define, but that doesn’t mean I can’t. I just don’t know what pin to use. I am happy to post pictures of the chassis/PCB, but there are a set of 8 LEDs on the back of the chassis, and in-hilt LEDs.

When I activate the saber now, using the bladeconfig and blade presets linked below, I get what seems to be some (6 out of 12?) of the in-hilt LEDs matching the blade color, as well as the blade illuminating when connected. However, I do not get anything on the 8 LEDs on the back of the chassis (not a need, but would be neat if it also displayed the blade color).

I am unsure I have this setup correctly, or why certain things are doing what they are doing. I’ve linked the default and currently used bladeconfigs for reference. Please note, I do not want to use a multi-blade setup for my blade styles, but want the in-hilt LEDs to come on when no blade is inserted. I also would like to understand more about how to use the three “blades” this install setup can be configured with. Thanks in advance.

MTFBWY

Current Blade Presets

Default BladeConfig

Current BladeConfig

First, it would be a lot easier if you just posted the entire config file instead of sections.

The pad on the board that is wired to a floating pogo pin on your hilt-side blade PCB is the one to use. In the Default Config (which you only posted a portion of) There is a define for how it’s set up. You would just use the default config and make the presets the way you want with fonts and styles.

Post the default config, then it will be easier to explain things.

Not sure what this means.
blade in and NOBLADE states would both have the same number of blades, you just set styles accordingly for what you want.
If you want accent LEDs off while blade in, give it a black style in that preset array.

If you want them on when NOBLADE, then you give it a style that does stuff in the NOBLADE array.
I think you might be overcomplicating it in your head. It’s actually pretty straight forward.

Did you read this?

Absolutely, and well before I posted. I have a gap in understanding between how to structure the config. Posting whole config shortly.

I don’t need the behind the chassis LEDs to illuminate, but rather only the in-hilt LEDs when no blade is inserted, and then only the blade when that blade is inserted. That’s what I mean by I don’t want a multi-blade setup for my styles.

The biggest gap I have is I don’t understand what hardware the default bladeconfig is referencing and where. I don’t know how to change the default bladeconfig (linked in OP) to a bladeconfig that confidently does what I want. Currently, I only have half of the in-hilt LEDs illuminating when no blade is inserted, for example. I also suspect those LEDs are not turning OFF when the blade is inserted.

Finding out what hardware is set up on which blade is easy, just set a different color style for each and light them up.
Ones you don’t want on for a certain state just get black sent to them.

The blade config remains constant. Maybe that’s what’s throwing you off.
Post the whole default config for help.

Thank you, and I know it’s simpler than I think it may be.

Here’s the current (not default) config

Default Config here

oh. Ok well first of all according to that default config they sent with the saber, it does not have Blade Detect set up (no pin designated, no 2 blade[] arrays, no 2 presets[] arrays.
So if they did not wire it that way, you can’t use it that way unless you rewire it to have a floating pogo pin wired to a data pad on the board.
You could use BladeID if you wanted to.
Should we go on?

Understood. So, then BladeID is the only way to distinguish whether a blade is in, and which blade/LEDs to use, right?

OK so to clarify what happens, you simply have 2 sets of presets.
Set A gets used if the blade is in,
set B gets used when the blade is out.
All you need to do as far as which blades get used and which are Black is to write styles for the appropriate presets the way you want.

For testing, I would suggest just a simple solid color that you can replace with a “real” style later, so you can identify which blade is which. (main is pretty obvious, but still…)

ok.
Since you have 3 blades, you need to set NUM_BLADES 3
So first, since you have zero wiring done specifically for Blade Detect or Blade ID properly, we need to use a BLADE_ID_CLASS that can sort of figure it out with the existing wiring.
That’s going to be define that goes in your CONFIG_TOP section that will useSnapshotBladeID.
You also need to tell the OS which LED pad(s) need to have power on even though the blade is turned off, so that it can sense the blade anyway.
The defines and explanatory comment look like this:

#define ENABLE_POWER_FOR_ID PowerPINS<bladePowerPin2, bladePowerPin3>
#define BLADE_ID_CLASS SnapshotBladeID<bladeIdentifyPin> 
// The following will use the speed-of-charging-a-capacitor method of blade ID which sometimes works without resistors 
// Blade ID can detect if a blade is connected or not, but it won't actually reach the NO_BLADE value, 
// so it's recommend to use something like 200000 instead of NO_BLADE in the blades[] array.
#define BLADE_ID_CLASS SnapshotBladeID<bladeIdentifyPin>

Next, you’ll need your 2 sets of presets, which you had set up correctly, but all blades need to be included.
So this is where if you want the main blade on (because the blade is in) but the chassis stuff to be off, then you’ll do a normal blade style for the main blade, then Black styles for the accent blades. Thusly:

#ifdef CONFIG_PRESETS

Preset bladein[] = {

{ "SomeFont", "tracks/SomeTrack.wav",
// Main Blade
    StylePtr<Red>(),
// Behind Chassis LEDs (likely since it's the 8 pixels)
    StylePtr<Black>(),
// In-Hilt accent LEDs
    StylePtr<Black>(), "somefont'}
 
 };


Preset noblade[] = {

{ "Font", "tracks/track.wav",
// Main Blade
    StylePtr<Black>(),
// Behind Chassis LEDs (likely since it's the 8 pixels)
    StylePtr<Green>(),
// In-Hilt accent LEDs
    StylePtr<Blue>(), "somefont'}
 
 };

Then the BladeConfig as you had it, but with all 3 blades in each, and the value for the NOBLADE replaced with the suggestion above.

BladeConfig blades[] = {

 { 0, WS281XBladePtr<108, bladePin, Color8::GRB, PowerPINS<bladePowerPin1, bladePowerPin2, bladePowerPin3> >(),
      WS281XBladePtr<8, blade2Pin, Color8::GRB, PowerPINS<bladePowerPin4> >(),
      SimpleBladePtr<CH1LED, CH2LED, NoLED, NoLED,bladePowerPin5, bladePowerPin6, -1, -1>(), 
 CONFIGARRAY(bladein), "00_bladeinSave"},

 { 200000, WS281XBladePtr<108, bladePin, Color8::GRB, PowerPINS<bladePowerPin1, bladePowerPin2, bladePowerPin3> >(),
           WS281XBladePtr<8, blade2Pin, Color8::GRB, PowerPINS<bladePowerPin4> >(),
           SimpleBladePtr<CH1LED, CH2LED, NoLED, NoLED,bladePowerPin5, bladePowerPin6, -1, -1>(), 
 CONFIGARRAY(no_blade), "01_nobladeSave"},

};

Thank you for this. It makes a great deal of sense. Doesn’t this setup require duplication of blade styles for bladein vs. no_blade?

I am aiming to have the no_blade behavior mirror the blade style/color of the main blade, but just on the in-hilt LEDs and/or behind chassis LEDs. I am not even married to making the behind chassis LEDs illuminate.

Yes, you would just copy the main blade style from the bladein preset section to the inHilt LEDs style in the noblade preset section.
Essentially just swapping the Black style and the actual style positions.

Thank you. Now how do we configure that given I have about 30 presets created on the ProffieOS Workbench?

I would not have space for the blade styles I have if I had to essentially duplicate them. How can I get around that?

Use OS6 Edit Mode styles which give you sort of all-in-one styles with a bunch of options you can change and save on a per preset basis.
You’d be pasting the same style over and over and therefore not using additional memory.

Pasting the same style doesn’t use memory?

Also, I use Edit Mode styles for everything already. I am worried about losing what was already in my config.ini with the new blades and save directory above.

Lastly, if I were to use the setup you articulated, I’d have to manage two Presets.ini files to match colors when there is no blade vs. when there is a blade. Am I wrong?

Practically none, correct.

Config.ini is not what you mean. Probably presets.ini.
If you currently have saved edits of some styles that you want to preserve, firstly you should backup that presets.ini to your computer and name it something clear so you know what it is.
Then, if you copy the styles those edits are for from your current config into the new config and upload, then save to generate a new presets.ini., you can then manually edit back in the lines pertaining to the styles you want modified.
@fett263 might chime in on an easier way to “get back to” the same look you’ve applied to a style, but off the top of my head it sounds like a manual edit.

you would have 2 new folders on your SD card named 00_bladeinSave and 01_nobladeSave, each containing a presets.ini for that state. If you want to copy from one to the other, that’s possible, yes.

Copying the presets.ini from one state to the other would apply the same edits assuming the styles in the respective presets were the same.

Right, but the target would be the style on a different blade. So manual edit then, yes?
Otherwise, to be able to apply it again via Edit Mode or the Workbench, one would have needed to write down the chosen option numbers and choices, then recreate in real time. Even something like a “copy style” option couldn’t apply, because putting in the blade would be different set of presets, and you’d get kicked out from Edit Mode, yes?
Not sure if anyone’s inserted a blade while in Edit Mode with Blade Detect setup.

If you have different styles between the two configs then they may or may not match, colors would probably work universally assuming the styles are using. Other things like options, time, positions would really depend on the individual style.

Same exact style, just different position

Preset bladein [] = {
........
main blade - style that's been edited and saved to presets.ini
accents - Black
chamber - Black

};

Preset noblade [] = {
........
main blade - Black
accents - style that's been edited and saved to presets.ini
chamber - Black

};