Bluetooth Blade Config Behavior

I’m having strange behavior with my config. I have a hilt with a V3.9 proffieboard wired for blade-detect and blade-id, with an OLED display and bluetooth module. I’m driving the bluetooth using the 3.3V pin (not SD power) and LED1. I’m using SimpleBladePtr to power the bluetooth, with StylePtr to turn it on.

The odd part: the bluetooth module works ONLY when it is the last blade defined in the blade array.

I’ve had odd behavior with SimpleBladePtr before when using it as a dummy blade to fill the blade array, but I found a work around so I stopped testing it–but now that the issue has popped up again, I thought I’d ask.

Here is my config:
#ifdef CONFIG_TOP#include “proffieboard_v3_config.h”#define NUM_BLADES 8#d - Pastebin.com

This is the working config-- but here is the blade definition that didn’t work:

> { NO_BLADE, 
>     WS281XBladePtr<16, blade2Pin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3, bladePowerPin4> >(), //emitter independent 
>     WS281XBladePtr<7, blade3Pin, Color8::GRB, PowerPINS<bladePowerPin5, bladePowerPin1> >(), //SIDE LIGHTS
>     WS281XBladePtr<2, blade4Pin, Color8::GRB, PowerPINS<bladePowerPin6> >(), //POMMEL ring
>     SimpleBladePtr<CreeXPE2WhiteTemplate<550>, NoLED, NoLED, NoLED, bladePowerPin1, -1, -1, -1>(), //bluetooth module 
>     SubBlade(0, 143, WS281XBladePtr<147, bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3, bladePowerPin4> >()), //main blade, irrelevant with NO BLADE
>     SubBlade(144, 144, NULL),  //null blade
>     SubBlade(145, 145, NULL),
>     SubBlade(146, 146, NULL),
>     CONFIGARRAY(no_blade_presets) },

The only difference is the order. Is there a problem I’m not seeing? Or does ProffieOS require that the SimpleBladePtr be the last blade type in the array?

Oh, one other oddity. when using the non-working config with the BT blade definition in the missle of the array, if I switched to the Power preset, where all the styles are &style_charging, it would start working, but not correctly/completely.

thanks,
JS

Potentially stupid question:

You moved the bladestyles around in the presets when you changed the order of the bladeconfig, right?

Does it work better if you use CH1LED instead of CreeXPE2WhiteTemplate?

Yes–the blade style order matched the blade definition order.
I “like” having the main blade last–so this is just annoying–but seemed like something worth asking about.

I can try that! but I don’t know the syntax. Is it as simple as replacing the CreeXPE2 section?
I’ll try asking ChatGTP. Copilot offered a version that just replaced CreeXPE2 and one that used it as part of a WS281XBladePtr.

thanks,
JS

Yep, just a replacement

SimpleBladePtr<CH1LED, NoLED, NoLED, NoLED, bladePowerPin1, -1, -1, -1>(), //bluetooth module 

I think this is the problem.
You have bladePowerPin1 used in both a neopixel blade AND a SimpleBlade, which doesn’t work well together.

Ah, I missed that. Those are only using LED5.
The perils of copy-and-paste.

I’ll fix the erroneous LED1 reference–and i"m halfway finished updating the CH1LED–but I’ll go back and try with the Cree if it works.

thanks again,
js

After correcting the erroneous LED parameter, I tested it with both the original CreeXPE2WhiteTemplate and CH1LED. The CH1LED worked–but the CreeXPE2 still does not work.

Here is the non-working config with CreeXPE2:
#ifdef CONFIG_TOP#include “proffieboard_v3_config.h”#define NUM_BLADES 8#d - Pastebin.com

Here is the working config with CH1LED:
#ifdef CONFIG_TOP#include “proffieboard_v3_config.h”#define NUM_BLADES 8#d - Pastebin.com

CreeXPE2WhiteTemplate is a bad choice for controlling a BT module, because it has overheating compensation in it. It’s meant for using with an actual CreeXPE2 LED. If the voltage is higher than what the LED+resistor combination should get, it uses PWM to reduce the amount of power given to the LED, hopefully preventing the LED from burning out.

However, a BT module isn’t going to like getting an 800Hz PWM signal as GND…

CH1LED has no overheating compensation in it.

Thanks for solving this–I will use the CH1LED going forward and make a note in my wiring diagram library. I was using it because an old thread recommended the CreeXPE2WhiteTemplate to turn on the LED for BT but I couldn’t find it again.