I wasn’t sure where this put in, but being wiring, thought I would try here. I also searched and didn’t see what I was looking for.
I have an E11 blaster kit I need to start on and plan the electronics out. It came with a fire selector switch in the grip. I has 4 pins - G, 1, 2, 3. (I assume, I need to meter it)
Is the blaster prop ready for this kind of switch to set stun/kill/auto? How would I wire that?
Maybe G to GND, “stun” position to BTN1, “fire” to BTN2, and “auto” to BTN3? That would essentially change any position to a long press, so I assume some prop changes are needed.
No, but it wouldn’t be that hard to fix.
Easiest thing would be to set it up as three latching switches, and then you would need to add some cases to the prop to make it work. (Latching switches only have EVENT_LATCH_ON and EVENT_LATCH_OFF, no long-, short- or double-clicks.)
There is no BUTTON_1/2/3.
You can see all the available button names here:
For a blaster, you probably want BUTTON_FIRE, but beware that it as the same number as BUTTON_UP and BUTTON_TRIGGER_FOUR
Now the good news is that latching events are not the same as regular button events, so you can actually re-use the same button IDs for this switch, and it would still work.
For instance, you could use BUTTON_TRIGGER_ONE/TWO/THREE for the three latching buttons, but you would have to make sure that there are no latching events for BUTTON_POWER in your prop, since it would be the same as BUTTON_TRIGGER_ONE.