So the project is a Luke Cave Hero hilt, and I want to add a third switch, latching, to the switchbox. With the switch OFF, the switchbox LEDs are OFF, but when you flick the switch ON, it lights the LEDs and also plays the cave scene sound effect.
And I think I’ve found an unconventional way of doing it, which is:
- Latching switch common to Batt+
- Latching switch OFF terminal to Button 3
- Latching Switch ON terminal to Switchbox LEDs positive
(There’s a simple schematic below).
Then I add this near the top of the prop file:
EFFECT(cave); // for custom 'Cave Scene' effect
And this lower down the prop file:
#if NUM_BUTTONS == 3 // Third button custom cave scene function.
case EVENTID(BUTTON_AUX2, EVENT_RELEASED, MODE_ANY_BUTTON | BUTTON_AUX2):
if (SFX_cave) { // Play Cave Scene sound effect.
hybrid_font.PlayCommon(&SFX_cave);
}
break;
#endif
Then set the config to 3 buttons and add this to the bottom of it:
#ifdef CONFIG_BUTTONS
Button PowerButton(BUTTON_POWER, powerButtonPin, "pow");
Button AuxButton(BUTTON_AUX, auxPin, "aux");
PullDownButton Aux2Button(BUTTON_AUX2, aux2Pin, "aux2");
#endif
So when saber has the switch in the OFF position, button 3 is effectively pressed and also ‘breaks’ battery positive to the switch LEDs. When you flick the switch, you ‘make’ power to the switch LEDs which also releases button 3 triggering the effect.
I’ve tested it on my Proffie 2.2 test rig and it works - will try a Proffie 3.9 tomorrow, but I assume it should be identical.
My question, given that this is quite an unusual, but very simple, way of achieving this, is there any reason I shouldn’t do it?
Also what happens if at some point in the future, someone reprogrammes the Proffie back to a standard 2 button setup? Will it matter that button 3 is shorted to Batt+ when the switch is OFF?
As always thoughts welcome. ![]()
Thanks in advance. ![]()
