No Blade Functionality

At one point up until recently, my saber would use the specific “no blade” font directory whenever a blade/blade plug was not inserted. Now, despite making a sound when inserting/removing a blade, the saber still ignites/retracts/behaves as though a blade is in when in fact there is no blade/plug. Any reason why this would have changed that I may be overlooking?

It wouldn’t have changed on it’s own, so SOMEthing must be different.
Post your config?

Thanks Brian. Here’s what I’m working with on this go 'round.


The config file looks like it should work well.
Maybe check with a multimeter if pin 17 has gotten shorted to + or - on the pogo pin board somehow?
Do you see anything in the serial monitor when you connect/disconnect a blade?

It’s weird that apparently bladein.wav and bladeout.wav are playing.
Assuming of course that

means a sound effect as opposed to beep or font.wav.

Actually, I may have an idea of what’s going on: savefiles!

You probably want to have separate save files for the no-blade case and the in-blade case, to do that you update your blades[] array to:

BladeConfig blades[] = {
 { 0, WS281XBladePtr<115, bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3> >(),
 { NO_BLADE, WS281XBladePtr<115, bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3> >(),
CONFIGARRAY(no_blade), "noblade" },

Now when there is no blade, it will read/write to “noblade/*”, when there is a blade, it will read/write to the top level directory.

1 Like

Come to think of it though, maybe that’s not it…
It would be nice to see what the serial monitor says.

Obvious n00b question…how do I see/export?

In Arduino, the top right corner magnifying glass icon opens Serial monitor.
You can select the text in there and copy/paste it here.

Thanks Brian. Pastebin here.

In the above sequence, I had the blade plug out, put it in, and then took it out again.

Thanks for checking into it.

The serial monitor shows that it’s detecting the blade/no blade condition correctly.
But then it loads the font THE_RETURN, regardless of whether the blade is there or not.
Since THE_RETURN is not in your config file, it’s either been added using edit mode / workbench, or your saber is actually running a different/older configuration than the one you showed us.

If it was added with edit mode / workbench, then I recommend adding the noblade save directory as I shows earlier in this thread.

Thanks. I did add THE_RETURN via Workbench. Can you give me more background info what different save files are just so I understand a bit more? Is it OS6’s Edit Mode/Workbench that prompted this change?

Thanks again!

It’s reasonably well described on the CONFIG_PRESETS page.
When you make an edit through the workbench (or edit mode) it gets saved in presets.ini on the sd card, and it basically makes a copy of your presets[] array at that time. However, since you want different presets in the no-blade case, it also needs to use a different savefile. By putting a directory name in the blades[] array, presets.ini will be read and written into that directory instead of just the top level.

Hope this makes sense.


I think I understand it partially. Will that new presets.ini replace my existing one, or just save in the new directory? Is that new Presets.ini just for the noblade case?

There won’t be a new one unless you use the ProffieOS Workbench without a blade attached.

If I use Workbench with no blade attached, will that overwrite my Presets.ini, or create a different one? I want the “no blade” sound font I have to be used for that case regardless.

To clarify, above I added a seperate save for the blade IN state as well called “Blade_In_Save”
Now you’d have 2 folders created on your SD card, each one containing the presets.ini for the corresponding state.
The Workbench is going to be operating on the presets.ini file that matches the current state of the saber, either blade in, or no blade.
Hope that helps explain.

Assuming that the save directory you specify exists, it will create a presets.ini in that directory. That means it will be separate from the regular one. If the save directory doesn’t exist, it will fail, although I’m not sure if it will just not remember anything, or if it will crash or something.