Bladeid 1023.00 how to setup the no blade

my config is as follows and I found the scanid

does anyone have the bladein.wav and bladeout.wav files for the faulty saber sounds?

am I right to replace the 0 in my blade array to 1023.00?

LGT1Button36v4.h (84.9 KB)

do I still need to put the following

// This is a simplified config file template set up for Blade ID.

#ifdef CONFIG_TOP
#define SHARED_POWER_PINS
// #define BLADE_DETECT_PIN blade4Pin
#define ENABLE_POWER_FOR_ID PowerPINS<bladePowerPin2, bladePowerPin3>
// #define BLADE_ID_CLASS ExternalPullupBladeID<bladeIdentifyPin, 33000> // value of resistor used
// #define BLADE_ID_CLASS BridgedPullupBladeID<bladeIdentifyPin, 9> // TX pad for example

/*  This will make it 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 I would recommend using something like 200000 instead of NO_BLADE. */
#define BLADE_ID_CLASS SnapshotBladeID<bladeIdentifyPin>

/*  Millis is Blade ID scan interval. If the blade ID comes out the same as before, it will do nothing.
    If it comes out different, it will do FindBladeAgain(), which will basically initialize the saber from 
    scratch and load the right settings for the new id().
    It will only work with neopixel blades, and requires SHARED_POWER_PINS to work. */
#define BLADE_ID_SCAN_MILLIS 1000
//    How many Blade ID scans to average
#define BLADE_ID_TIMES 15
// other defines go here
#endif

#ifdef CONFIG_PROP
#include "../props/PROP_FILE_OF_CHOICE_GOES_HERE.h"
#endif


#ifdef CONFIG_PRESETS

Preset blade_1 [] = {

is it possible to have the bladein and bladeout files in the root of the sd card so all the fonts use the same sound?

ProffieOS will not attempt any kind of blade ID if you only have one entry in your blades[] array, and as long as you have only one entry, it doesn’t matter what value you put there.

which part?

You can put them in “common”.

do I need the following defines in my config_top section?

e.g.

#define SHARED_POWER_PINS

#define ENABLE_POWER_FOR_ID PowerPINS<bladePowerPin2, bladePowerPin3>

#define BLADE_ID_CLASS SnapshotBladeID<bladeIdentifyPin>

#define BLADE_ID_SCAN_MILLIS 1000

#define BLADE_ID_TIMES 15

#endif

#ifdef CONFIG_PROP
BladeConfig blades[] = {
  { 1023.00,
    WS281XBladePtr<114, bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3> >(),
    CONFIGARRAY(blade_1), "blade_1_Save" },
  WS281XBladePtr<1, bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3> >(),
    CONFIGARRAY(no_blade), "no_blade_Save" }

would this achieve those goals?

I wasn’t sure if that would ruin the edit mode, but thanks for confirming that.

so If I want to have the blade out make a sound all I need to do is place the bladein and bladeout.wav in the common directory, is that all? or do I need to put a line in the blade section?

That stuff is if you want to have blade ID run every couple of seconds.
Without that, blade ID only runs when ProffieOS boots.
You probably want that, but it may also cause problems, YMMV.

yes, but you’re missing { NO_BLADE, at the beginning on line 5. (And the }; at the end, but that’s probably just a copy-paste thing.)

e.g.

BladeConfig blades[] = {
  { 1023.00,
    WS281XBladePtr<114, bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3> >(),
    CONFIGARRAY(blade_1), "blade_1_Save" },
  { NO_BLADE, WS281XBladePtr<1, bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3> >(),
    CONFIGARRAY(no_blade), "no_blade_Save" }

That looks better.
(I assume you have }; on the next line.)

1 Like

the v2 voicepacks already have them. sweet.

LGT1Button36v5.h (85.1 KB)

this didn’t work the error is.

--- Compile started ---
Config staged to: /home/deck/.config/jmt-studio/ProffieOS/config/my_config.h
> arduino-cli compile --fqbn proffieboard:stm32l4:ProffieboardV2-L433CC:usb=cdc_msc_webusb,dosfs=sdspi,speed=80,opt=os,pclk=2 --build-path /home/deck/.config/jmt-studio/build-output --warnings none --verbose /home/deck/.config/jmt-studio/ProffieOS --config-file=/home/deck/.config/jmt-studio/arduino-data/arduino-cli.yaml
FQBN: proffieboard:stm32l4:ProffieboardV2-L433CC:usb=cdc_msc_webusb
Using board 'ProffieboardV2-L433CC' from platform in folder: /home/deck/.arduino15/packages/proffieboard/hardware/stm32l4/4.6
Using core 'stm32l4' from platform in folder: /home/deck/.arduino15/packages/proffieboard/hardware/stm32l4/4.6
Detecting libraries used...
/home/deck/.arduino15/packages/proffieboard/tools/arm-none-eabi-gcc/14-2-rel1-xpack/bin/arm-none-eabi-g++ -mcpu=cortex-m4 -mthumb -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib -fno-rtti -fno-exceptions -flto -fdevirtualize-at-ltrans -w -x c++ -E -CC -D_SYSTEM_CORE_CLOCK_=80000000L -D_SYSTEM_PCLK_DIVIDER_=2 -DARDUINO=10607 -DARDUINO_STM32L4_BUTTERLY -DARDUINO_ARCH_STM32L4 -DSTM32L433xx -DPROFFIEBOARD_VERSION=2 -D__FPU_PRESENT=1 -march=armv7e-m -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mabi=aapcs -mslow-flash-data -fsingle-precision-constant -felide-constructors -ffast-math -DUSB_VID=0x1209 -DUSB_PID=0x6668 -DUSB_DID=0xffff -DUSB_MANUFACTURER="hubbe.net" -DUSB_PRODUCT="Proffieboard" -DUSB_TYPE=USB_TYPE_CDC_MSC_WEBUSB -DDOSFS_SDCARD=1 -DDOSFS_SFLASH=0 -I/home/deck/.arduino15/packages/proffieboard/hardware/stm32l4/4.6/system/CMSIS/Include -I/home/deck/.arduino15/packages/proffieboard/hardware/stm32l4/4.6/system/CMSIS/Device/ST/STM32L4xx/Include -I/home/deck/.arduino15/packages/proffieboard/hardware/stm32l4/4.6/system/STM32L4xx/Include -I/home/deck/.arduino15/packages/proffieboard/hardware/stm32l4/4.6/cores/stm32l4 -I/home/deck/.arduino15/packages/proffieboard/hardware/stm32l4/4.6/variants/STM32L433CC-ProffieboardV2 /home/deck/.config/jmt-studio/build-output/sketch/ProffieOS.ino.cpp -o /dev/null
Alternatives for Wire.h: [Wire@1.0]
ResolveLibrary(Wire.h)
  -> candidates: [Wire@1.0]
/home/deck/.arduino15/packages/proffieboard/tools/arm-none-eabi-gcc/14-2-rel1-xpack/bin/arm-none-eabi-g++ -mcpu=cortex-m4 -mthumb -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib -fno-rtti -fno-exceptions -flto -fdevirtualize-at-ltrans -w -x c++ -E -CC -D_SYSTEM_CORE_CLOCK_=80000000L -D_SYSTEM_PCLK_DIVIDER_=2 -DARDUINO=10607 -DARDUINO_STM32L4_BUTTERLY -DARDUINO_ARCH_STM32L4 -DSTM32L433xx -DPROFFIEBOARD_VERSION=2 -D__FPU_PRESENT=1 -march=armv7e-m -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mabi=aapcs -mslow-flash-data -fsingle-precision-constant -felide-constructors -ffast-math -DUSB_VID=0x1209 -DUSB_PID=0x6668 -DUSB_DID=0xffff -DUSB_MANUFACTURER="hubbe.net" -DUSB_PRODUCT="Proffieboard" -DUSB_TYPE=USB_TYPE_CDC_MSC_WEBUSB -DDOSFS_SDCARD=1 -DDOSFS_SFLASH=0 -I/home/deck/.arduino15/packages/proffieboard/hardware/stm32l4/4.6/system/CMSIS/Include -I/home/deck/.arduino15/packages/proffieboard/hardware/stm32l4/4.6/system/CMSIS/Device/ST/STM32L4xx/Include -I/home/deck/.arduino15/packages/proffieboard/hardware/stm32l4/4.6/system/STM32L4xx/Include -I/home/deck/.arduino15/packages/proffieboard/hardware/stm32l4/4.6/cores/stm32l4 -I/home/deck/.arduino15/packages/proffieboard/hardware/stm32l4/4.6/variants/STM32L433CC-ProffieboardV2 -I/home/deck/.arduino15/packages/proffieboard/hardware/stm32l4/4.6/libraries/Wire/src /home/deck/.config/jmt-studio/build-output/sketch/ProffieOS.ino.cpp -o /dev/null
Using cached library dependencies for file: /home/deck/.arduino15/packages/proffieboard/hardware/stm32l4/4.6/libraries/Wire/src/Wire.cpp
Generating function prototypes...
/home/deck/.arduino15/packages/proffieboard/tools/arm-none-eabi-gcc/14-2-rel1-xpack/bin/arm-none-eabi-g++ -mcpu=cortex-m4 -mthumb -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib -fno-rtti -fno-exceptions -flto -fdevirtualize-at-ltrans -w -x c++ -E -CC -D_SYSTEM_CORE_CLOCK_=80000000L -D_SYSTEM_PCLK_DIVIDER_=2 -DARDUINO=10607 -DARDUINO_STM32L4_BUTTERLY -DARDUINO_ARCH_STM32L4 -DSTM32L433xx -DPROFFIEBOARD_VERSION=2 -D__FPU_PRESENT=1 -march=armv7e-m -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mabi=aapcs -mslow-flash-data -fsingle-precision-constant -felide-constructors -ffast-math -DUSB_VID=0x1209 -DUSB_PID=0x6668 -DUSB_DID=0xffff -DUSB_MANUFACTURER="hubbe.net" -DUSB_PRODUCT="Proffieboard" -DUSB_TYPE=USB_TYPE_CDC_MSC_WEBUSB -DDOSFS_SDCARD=1 -DDOSFS_SFLASH=0 -I/home/deck/.arduino15/packages/proffieboard/hardware/stm32l4/4.6/system/CMSIS/Include -I/home/deck/.arduino15/packages/proffieboard/hardware/stm32l4/4.6/system/CMSIS/Device/ST/STM32L4xx/Include -I/home/deck/.arduino15/packages/proffieboard/hardware/stm32l4/4.6/system/STM32L4xx/Include -I/home/deck/.arduino15/packages/proffieboard/hardware/stm32l4/4.6/cores/stm32l4 -I/home/deck/.arduino15/packages/proffieboard/hardware/stm32l4/4.6/variants/STM32L433CC-ProffieboardV2 -I/home/deck/.arduino15/packages/proffieboard/hardware/stm32l4/4.6/libraries/Wire/src /home/deck/.config/jmt-studio/build-output/sketch/ProffieOS.ino.cpp -o /tmp/1128613775/sketch_merged.cpp
/home/deck/.arduino15/packages/builtin/tools/ctags/5.8-arduino11/ctags -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives /tmp/1128613775/sketch_merged.cpp
Compiling sketch...

The above does not show an error.
If there was an error, it would have occurred after “Compiling sketch…”

In file included from /home/deck/.config/jmt-studio/ProffieOS/ProffieOS.ino:613:
/home/deck/.config/jmt-studio/ProffieOS/config/my_config.h:400:17: error: 'blade_1' was not declared in this scope; did you mean 'blades'?
  400 |     CONFIGARRAY(blade_1), "blade_1_Save" },
      |                 ^~~~~~~
/home/deck/.config/jmt-studio/ProffieOS/common/preset.h:7:24: note: in definition of macro 'CONFIGARRAY'
    7 | #define CONFIGARRAY(X) X, NELEM(X)
      |                        ^
In file included from /home/deck/.config/jmt-studio/ProffieOS/common/capabilities.h:4,
                 from /home/deck/.config/jmt-studio/ProffieOS/ProffieOS.ino:51:
/home/deck/.config/jmt-studio/ProffieOS/config/my_config.h:400:17: error: 'blade_1' was not declared in this scope; did you mean 'blades'?
  400 |     CONFIGARRAY(blade_1), "blade_1_Save" },
      |                 ^~~~~~~
/home/deck/.config/jmt-studio/ProffieOS/common/common.h:18:26: note: in definition of macro 'NELEM'
   18 | #define NELEM(X) (sizeof(X)/sizeof((X)[0]))
      |                          ^
/home/deck/.config/jmt-studio/ProffieOS/config/my_config.h:400:5: note: in expansion of macro 'CONFIGARRAY'
  400 |     CONFIGARRAY(blade_1), "blade_1_Save" },
      |     ^~~~~~~~~~~
/home/deck/.config/jmt-studio/ProffieOS/config/my_config.h:400:17: error: 'blade_1' was not declared in this scope; did you mean 'blades'?
  400 |     CONFIGARRAY(blade_1), "blade_1_Save" },
      |                 ^~~~~~~
/home/deck/.config/jmt-studio/ProffieOS/common/common.h:18:37: note: in definition of macro 'NELEM'
   18 | #define NELEM(X) (sizeof(X)/sizeof((X)[0]))
      |                                     ^
/home/deck/.config/jmt-studio/ProffieOS/config/my_config.h:400:5: note: in expansion of macro 'CONFIGARRAY'
  400 |     CONFIGARRAY(blade_1), "blade_1_Save" },
      |     ^~~~~~~~~~~
/home/deck/.config/jmt-studio/ProffieOS/config/my_config.h:402:17: error: 'no_blade' was not declared in this scope
  402 |     CONFIGARRAY(no_blade), "no_blade_Save" }
      |                 ^~~~~~~~
/home/deck/.config/jmt-studio/ProffieOS/common/preset.h:7:24: note: in definition of macro 'CONFIGARRAY'
    7 | #define CONFIGARRAY(X) X, NELEM(X)
      |                        ^
/home/deck/.config/jmt-studio/ProffieOS/config/my_config.h:402:17: error: 'no_blade' was not declared in this scope
  402 |     CONFIGARRAY(no_blade), "no_blade_Save" }
      |                 ^~~~~~~~
/home/deck/.config/jmt-studio/ProffieOS/common/common.h:18:26: note: in definition of macro 'NELEM'
   18 | #define NELEM(X) (sizeof(X)/sizeof((X)[0]))
      |                          ^
/home/deck/.config/jmt-studio/ProffieOS/config/my_config.h:402:5: note: in expansion of macro 'CONFIGARRAY'
  402 |     CONFIGARRAY(no_blade), "no_blade_Save" }
      |     ^~~~~~~~~~~
/home/deck/.config/jmt-studio/ProffieOS/config/my_config.h:402:17: error: 'no_blade' was not declared in this scope
  402 |     CONFIGARRAY(no_blade), "no_blade_Save" }
      |                 ^~~~~~~~
/home/deck/.config/jmt-studio/ProffieOS/common/common.h:18:37: note: in definition of macro 'NELEM'
   18 | #define NELEM(X) (sizeof(X)/sizeof((X)[0]))
      |                                     ^
/home/deck/.config/jmt-studio/ProffieOS/config/my_config.h:402:5: note: in expansion of macro 'CONFIGARRAY'
  402 |     CONFIGARRAY(no_blade), "no_blade_Save" }
      |     ^~~~~~~~~~~
Using library Wire at version 1.0 in folder: /home/deck/.arduino15/packages/proffieboard/hardware/stm32l4/4.6/libraries/Wire 
e[92mUsed librarye[0m e[92mVersione[0m e[90mPathe[0m
e[93mWiree[0m         1.0     e[90m/home/deck/.arduino15/packages/proffieboard/hardware/stm32l4/4.6/libraries/Wiree[0m
e[92mUsed platforme[0m        e[92mVersione[0m e[90mPathe[0m
e[93mproffieboard:stm32l4e[0m 4.6     e[90m/home/deck/.arduino15/packages/proffieboard/hardware/stm32l4/4.6e[0m
Error during build: exit status 1
--- Compile failed ---

Do you have a preset array called blade_1 ?

Doesn’t look like it, just presets.
If you want the same set of presets when the blade is in and out, just replace “blade_1” and “no_blade” with “presets”.
If you want them to be different, make two preset arrays, one called “blade_1” and one called “no_blade”.

I did the first option but the sound did not play.

When you refer to the Preset are saying this?

#ifdef CONFIG_PRESETS

Preset presets[] = {
{ "BalVenos;BalVenos/common" BladeConfig blades[] = {
  { 1023.00,
    WS281XBladePtr<114, bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3> >(),
    CONFIGARRAY(presets), "blade_1_Save" },
  { NO_BLADE, WS281XBladePtr<1, bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3> >(),
    CONFIGARRAY(presets), "no_blade_Save" }
};

It compiles but nothing happens despite all the commons have bladein and bladeout files

There should still be the one’s I posted up in The Free Font Library. Check under the blade detect stuff if you can’t find “Glitch” since when I started the blade detect sound option project some of those got moved in there. Also check your DM’s in the book of faces.

1 Like

so I was wondering what does it look like when it is two separate Presets:

is it Preset name of the blade array[] = {

{“font;common”, “tracks/font.wav”,

I’m not sure what to put here for the no blade array?

}

};

below I changed it to how I think it should be but I’m still getting errors, what am I doing wrong?

LGT1Button36v6.h (85.2 KB)

In file included from /home/deck/.config/jmt-studio/ProffieOS/ProffieOS.ino:390:
/home/deck/.config/jmt-studio/ProffieOS/common/events.h:110:18: error: expected unqualified-id before numeric constant
  110 | #define NO_BLADE 1000000000 /* 1 billion */
      |                  ^~~~~~~~~~
/home/deck/.config/jmt-studio/ProffieOS/config/my_config.h:396:8: note: in expansion of macro 'NO_BLADE'
  396 | Preset NO_BLADE[] = {
      |        ^~~~~~~~
In file included from /home/deck/.config/jmt-studio/ProffieOS/common/capabilities.h:4,
                 from /home/deck/.config/jmt-studio/ProffieOS/ProffieOS.ino:51:
/home/deck/.config/jmt-studio/ProffieOS/common/common.h:18:39: error: invalid types 'int[int]' for array subscript
   18 | #define NELEM(X) (sizeof(X)/sizeof((X)[0]))
      |                                       ^
/home/deck/.config/jmt-studio/ProffieOS/common/preset.h:7:27: note: in expansion of macro 'NELEM'
    7 | #define CONFIGARRAY(X) X, NELEM(X)
      |                           ^~~~~
/home/deck/.config/jmt-studio/ProffieOS/config/my_config.h:409:5: note: in expansion of macro 'CONFIGARRAY'
  409 |     CONFIGARRAY(NO_BLADE), "no_blade_Save" }
      |     ^~~~~~~~~~~
Using library Wire at version 1.0 in folder: /home/deck/.arduino15/packages/proffieboard/hardware/stm32l4/4.6/libraries/Wire 
e[92mUsed librarye[0m e[92mVersione[0m e[90mPathe[0m
e[93mWiree[0m         1.0     e[90m/home/deck/.arduino15/packages/proffieboard/hardware/stm32l4/4.6/libraries/Wiree[0m
e[92mUsed platforme[0m        e[92mVersione[0m e[90mPathe[0m
e[93mproffieboard:stm32l4e[0m 4.6     e[90m/home/deck/.arduino15/packages/proffieboard/hardware/stm32l4/4.6e[0m
Error during build: exit status 1
--- Compile failed ---

Brian’s v2 voicepack all have it as well. but you can’t have too many sound files. right?

Hi team,

I’m still having issues using the bladeid can someone show me how you setup yours so I can compare it?

I think you need the NO_BLADE_ID_RANGE define:

Either that, or blade detect.