Blade Detect No_Blade_Save?

Can one of the oracles here just check my thinking on something…

I’m working on a hilt where I want the removable chassis to trigger the blade detect sound. It will be more chassis detect than blade detect, but the principle will be the same.

I’ve sorted the mechanism by which the blade detect pad (in this case data 3) will short to the blade LED ground upon insertion, but I just spotted this bit in the documentation which I’ve not seen before:

Please note the “nbsave” part, which will make ProffieOS save presets.ini and other related save files into the “nbsave/” directory on the SD card. If that directory doesn’t exist, saving will fail, but that might be ok for the no-blade case.

I’m guessing this only applies if you want potentially different save states for blade in and blade out. Have I got that right?

In my case, the two blade arrays are identical apart from the chassis accent LED. For blade in, I was going to simply set it to OFF as it won’t be visible inside the hilt, but other than that, the list of fonts/presets and everything else will be identical for blade in and blade out states.

Which I’m guessing means I don’t need a separate nb_save folder, as the normal save files will be used for both blade in and blade out, which is what I want.

Have I understood it right?

Thanks as always.

I’d wired it so Data 3 would short to the main blade LED pads 2 and 3 as per the manual. However I’m finding it doesn’t work. But if I short Data 3 to Ground or to the accent LED pad (which is lit with the main blade off) or if I short to the main blade LED pads with the blade lit, it works fine.

It’s no biggie for this install as I can just move the wire to Ground to make it work, but I’m curious to know if anything has changed since the manual was written? I confess I’ve not used BD much, and the last time I used it, the main blade was sharing power pins with some other accents which were lit with the blade off, so the Shared Power Pins define made it all work.

Thanks in advance for any thoughts. It’d be good to get this all square in my head.

Sounds like you have this right. If the blade arrays were different, then saving which preset you are on wouldn’t work unless you had separate save directories.

Wiring it to LED2/3 will only work if you want it to detect the presence of a blade. When FETs are off, it relies on the current draw of the LEDs to pull the signal BD pin HIGH. With no blade, that doesn’t happen, which is of course what you want for blade detect. If you’re using it to detect a chassis, you should short it to something else, GND is ideal.

The only reason it works like this for blade detect is that there is limited pins to work with in a blade PCB, if you have a spare pin on the chassis → hilt connection, and you can connect it to GND, just do that, much cleaner and simpler.

1 Like

Sincere thanks as always Prof. This is great info and much appreciated. :smiley:

Yeh, I moved the short to Ground once I’d read the Documentation page. Thanks for clarifying how it works. :slight_smile: I see what you mean about the limited pins on an actual blade making the use of the FETs somewhat of a workaround, but the whole thing is a great system nonetheless. :+1: :ok_hand:

It does occur to me though that if I’d completed the install before I tested it, it might have worked regardless, as the short, although being done in a chassis-to-hilt connector, would ultimately be connecting the chassis to the neopixel blade connector which includes a bunch of LEDs. I was just testing it with a jumper wire, which presumably accounts for the failure.

Good to know about the different save files too. I’ve not experimented too much with Blade Detect (as evidenced by this thread! LOL!) but there are clearly a lot of possibilities. I assume I’m right in saying that if I did want different blade arrays, I would just need to create a folder called nbsave, then the bit in the inverted commas in the blade array below is what points the save files for no_blade presets to that file, yes?

   BladesConfig blades[] = {
      { 0,
        WS281XBladePtr<144, bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3> >(),
        CONFIGARRAY(blade_in) },

      { NO_BLADE,
        WS281XBladePtr<144, bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3> >(),
        CONFIGARRAY(no_blade), "nbsave" }

If you use SAVE_PRESET or similar, the presets.ini file gets written. If no save directory is specified in the configarray, it gets written to the root level of the SD card. If you do specify a directory name, then it gets saved in there instead.

1 Like

Thanks Brian. These are all great nuggets of info that I’ve somehow missed up until now. :smiley:
Thanks again both.