Is this a valid blade config?

I’m constructing my first Proffie Saber (it was working this morning, but then I slipped and the tac-switch that served as my power button underwent one of those rapid unscheduled disassembly moments. Replacement on order.) I built a short testing blade with the off-cuts from the main blade and I have an illuminated hilt side PCB. When I enter this config array into @Fett263 's config helper, I get stuck in a loop where it tells me…

This tool can only create 3 unique CONFIGARRAYS, additional CONFIGARRAYS are listed in your BladeConfig and will need to be manually added to the config before uploading.

…which just reappears each time I click Okay.

BladeConfig blades[] = {
 { 2200, WS281XBladePtr<15, bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3> >(),
    CONFIGARRAY(short_blade), "short_blade_save" },
 { 15000, WS281XBladePtr<132, bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3> >(),
    CONFIGARRAY(long_blade), "long_blade_save" },
 { NO_BLADE,
    WS281XBladePtr<16, blade2Pin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3> >(),
    CONFIGARRAY(no_blade), "no_blade_save" },
};

My intention is that the LED’s in the hilt side PCB are only active if there is no recognised blade present and the rest of the time they are off.

What have I got wrong?

The tool expects one CONFIGARRAY named “presets”, so it’s counting 3 additional. Change your first to “presets” and it should run.

BladeConfig blades[] = {
 { 2200, WS281XBladePtr<15, bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3> >(),
    CONFIGARRAY(presets), "short_blade_save" },
 { 15000, WS281XBladePtr<132, bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3> >(),
    CONFIGARRAY(long_blade), "long_blade_save" },
 { NO_BLADE,
    WS281XBladePtr<16, blade2Pin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3> >(),
    CONFIGARRAY(no_blade), "no_blade_save" },
};

I can tell you about the latest version using real time Blade ID.
If anyone feels I’m spreading misinformation, please let me know, but I am speaking from the results from development testing.

– Real Time BladeID –

Use data1 for a parallel connection to the PCB LEDs and the main blade. (not serial/subblade).

Blades can use the same set of presets, or have a Presets array for each blade.
Arrays should be named differently like no_blade, short_blade, long_blade, etc…
Match Preset array names to the CONFIGARRAY for the given blade.

Open Serial Monitor in Arduino and type id to read the resistance value.
It will display “BLADE ID: (some number)”
Use that value in the blade definition in the BladeConfig.

  • Note * It is recommended to use a Blade ID resistor in each blade
    to ensure different and distant enough resistance values between blades.

However, in testing, values reported for a chassis alone,
chassis inserted into the hilt (connected to emitter PCB)
and then main blade inserted all gave different enough values on their own
without added resistors and it worked fine. YMMV.

A v2.2 Proffieboard uses BLADE_ID_CLASS SnapshotBladeID
While that works pretty well with Blade ID resistors installed, it probably isn’t good enough for raw, un-resistored blades.
To get accurate, actual readings, the easiest thing to do is to solder bridge data1 to the adjacent TX pad, then use
#define BLADE_ID_CLASS BridgedPullupBladeID<bladeIdentifyPin, 9>

Then use these defines as well:

// Use with Blade ID. Specify the LED pad(s) that the main blade uses.
#define ENABLE_POWER_FOR_ID PowerPINS<bladePowerPin2, bladePowerPin3>

// Choose how often to check for new blade (milliseconds).
// Larger values will be a longer delay before a blade is recognized.
#define BLADE_ID_SCAN_MILLIS 1000

// How many Blade ID scans to average (default is 10, 15 might be better
#define BLADE_ID_TIMES 15

// Required when blades on different data pads use common LED power pads.
// and/or when BLADE_ID_SCAN_MILLIS is used with Blade ID.
#define SHARED_POWER_PINS

Now you just set up a Preset array for each state. You want StylePtr<Black>() for your PCB in the 2 arrays for blades, and vice versa for the blades in the array for the PCB.

Lots of words, but does that make sense?

See my reply, the Config Helper Tool expects one CONFIGARRAY named “presets” or it won’t accept the BladeConfig if you have 3 CONFIGARRAYs, so to use the tool you would change “short blade” to “presets” and it can parse and lay out the config properly.

Yes, I started typing that long reply prior to your explanation.
Once the config is generated, for OCD/consistency, the first preset array could be named accordingly. :wink:

*Only if done outside the tool

Ah ha! Many thanks…

Actually, I’m still getting the same error even if I cut and paste the config that you edited…

Hmm, ok I’ll need to investigate then but it may take a while, I’m pretty swamped.

Actually, just click past the error 3 or 4 times and it should pass and handle. I think I need to fix the error message trigger.