I’ve set up a blade plug charger and used BladeID so the hilt can differentiate between charger and no blade/normal blade. I’ve set it to jump to the charge preset automatically when the charger plug is inserted.
But although it skips to the preset successfully, it doesn’t play the charge preset font ident wav.
My question is should it?
I’m sure when I’ve done it in the past, it has, but I think I was also using Blade Detect in those builds - whereas this current hilt uses just Blade ID (i.e. no extra wiring, just a 22k-ohm resistor in the blade plug charger telling the hilt it’s not a normal blade).
Just wondering if this is expected behaviour? The relevant bit of the config is below:
{ "FontStd2/Battery;Shared/Random;Shared/Function", "tracks/rey.wav",
// Main Blade:
&style_charging,
// Crystal Chamber:
&style_charging,
// Plasma gate 1:
&style_charging,
// Plasma gate 2:
&style_charging,
// Emitter Back:
&style_charging,
// 5mm Red LED:
StylePtr<Layers<Layers<Rgb<180,180,180>,BlinkingL<Black,Int<750>,Int<500>>>,InOutHelperL<InOutFuncX<Int<300>,Int<800>>,Blinking<Black,Rgb<180,180,180>,2900,500>>>>(),
// Proffie Micro LED:
StylePtr<Layers<Layers<Black,BlinkingL<Rgb<140,140,140>,Int<700>,Int<500>>>,InOutHelperL<InOutFuncX<Int<300>,Int<800>>,Blinking<Black,Rgb<140,140,140>,1500,500>>>>(),
// Duel Strips:
&style_charging,
"battery"},
};
// *************************
Preset charging[] = {
{ "FontStd2/Charger;Shared/Random;Shared/Function", "tracks/endtitle.wav",
// Main Blade:
ChargingStylePtr<InOutHelper<Black,300,300,Pulsing<Black,Black,3000>>>(),
// Crystal Chamber:
ChargingStylePtr<Blinking<Red,Blue,2600,500>>(),
// Plasma gate 1:
ChargingStylePtr<Black>(),
// Plasma gate 2:
ChargingStylePtr<Black>(),
// Emitter Back:
ChargingStylePtr<Black>(),
// 5mm Red LED:
ChargingStylePtr<Black>(),
// Proffie Micro LED:
ChargingStylePtr<Black>(),
// Duel Strips:
ChargingStylePtr<Black>(),
"charging"},
};
// *************************
template<int milliohms = 100000>
struct RedLED {
static constexpr float MaxAmps = 0.02;
static constexpr float MaxVolts = 2.1;
static constexpr float P2Amps = 0.01;
static constexpr float P2Volts = 1.8;
static constexpr float R = milliohms / 1000.0;
// LED color
static const int Red = 255;
static const int Green = 0;
static const int Blue = 0;
};
// 3mm Blue
template<int milliohms = 47000>
struct BlueLED {
static constexpr float MaxAmps = 0.02;
static constexpr float MaxVolts = 3.1;
static constexpr float P2Amps = 0.01;
static constexpr float P2Volts = 3.05;
static constexpr float R = milliohms / 1000.0;
// LED color
static const int Red = 255;
static const int Green = 255;
static const int Blue = 255;
};
// *************************************************************************
// KR V2 pixel strip blade lengths:
// 88cm = 132 pixels.
// 82cm = 122 pixels.
// 72cm = 108 pixels.
BladeConfig blades[] = {
{ 84,
// Main Blade:
WS281XBladePtr<132, bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3>>(),
// Crystal Chamber:
WS281XBladePtr<1, blade4Pin, Color8::RGB, PowerPINS<bladePowerPin4>>(),
// Plasma gate 1:
SubBlade (0, 0, WS281XBladePtr<3, blade3Pin, Color8::GRB, PowerPINS<bladePowerPin4>>()),
// Plasma gate 2:
SubBlade(1, 1, NULL),
// Emitter Back:
SubBlade(2, 2, NULL),
// 5mm Red LED:
SimpleBladePtr<RedLED<100000>, NoLED, NoLED, NoLED, bladePowerPin6, -1, -1, -1>(),
// Proffie Micro LED:
SimpleBladePtr<BlueLED<47000>, NoLED, NoLED, NoLED, bladePowerPin1, -1, -1, -1>(),
// Duel Strips:
SubBladeReverse (0, 3, WS281XBladePtr<4, blade2Pin, Color8::GRB, PowerPINS<bladePowerPin5>>()),
CONFIGARRAY(presets) },
// Use for blade plug charging.
// Main blade must be data 1.
{ 53,
// Main Blade:
WS281XBladePtr<132, bladePin, Color8::GRB, PowerPINS<bladePowerPin2, bladePowerPin3>>(),
// Crystal Chamber:
WS281XBladePtr<1, blade4Pin, Color8::RGB, PowerPINS<bladePowerPin4>>(),
// Plasma gate 1:
SubBlade (0, 0, WS281XBladePtr<3, blade3Pin, Color8::GRB, PowerPINS<bladePowerPin4>>()),
// Plasma gate 2:
SubBlade(1, 1, NULL),
// Emitter Back:
SubBlade(2, 2, NULL),
// 5mm Red LED:
SimpleBladePtr<RedLED<100000>, NoLED, NoLED, NoLED, bladePowerPin6, -1, -1, -1>(),
// Proffie Micro LED:
SimpleBladePtr<BlueLED<47000>, NoLED, NoLED, NoLED, bladePowerPin1, -1, -1, -1>(),
// Duel Strips:
SubBladeReverse (0, 3, WS281XBladePtr<4, blade2Pin, Color8::GRB, PowerPINS<bladePowerPin5>>()),
CONFIGARRAY(charging) },
};
#endif