Hello @profezzorn ,
Thank you for your insight. I had not noticed there was two different syntax.
I don’t think I red anything about that. I did see in some sound fonts some Alt-sounds but I don’t know anything about it or what they are for ?
I have been thinking about the following for the last few days.
So I came up with several ideas (to achieve the same thing) while reading through the code of dual_props.h, the files in buttons and several others *.h (for which I have, mostly, no idea what they do, especially the ones that don’t have any “// xxx…” with your notes).
idea 1) My favorite idea would be to create a new prop (I’d call it “multi_prop.h” which is based on dual_prop.h and would replace blade detect with “two buttons long push”, and would allow to switch from saber to blaster to saber to detonator and back to saber. The idea of the code would be something like this :
"create variable" "state_of_prop" (value 0 or 1 or 2)
// "state_of_prop" = 0 = saber, = 1 = blaster, = 2 = detonator
"create variable" "previous_state_of_prop" (value 1 or 2)
// "previous_state_of_prop" = 1 = blaster, = 2 = detonator
if (two buttons long push detected)
// or even "very" long push, if there is already a 2 buttons long push in POS
// I am referring to "BUTTON_HELD_LONG_TIMEOUT 2000" from ".../buttons/button_base.h, could add "BUTTON_HELD_VERY_LONG_TIMEOUT 4000"
then
if "state_of_prop" different than 0 (zero)
then - set "state_of_prop" to 0
- switch to saber and buttons behave like saber
else
if "previous_state_of_prop" = 1
then - set "previous_state_of_prop" to 2
//the idea is for the prop to "remember" what state it was before being a saber
- set "state_of_prop" to 2
- switch to detonator and buttons behave like detonator
else - set "previous_state_of_prop" to 1
- set "state_of_prop" to 1
- switch to blaster and buttons behave like blaster (and lets not forget bullet counts for the OLED)
endif
endif
idea 2) create a “dual_prop2.h” where “blade detect” is replaced by “two buttons long push”. The problem I see is that “blade detect” is a latching switch and the “two buttons long push” are not.
idea 3) add a 3rd latching button on my saber and replace “blade detect” in “dual_prop.h” with the 3rd button. How would I wire the third button while still keeping blade detect (I want my light saber to be able to do everything) ?
idea 4) While looking at the configurator for Pfoffie V3 for idea 3), I saw the Touchbutton. Maybe it could be used in idea 1) where the top is blaster, the middle is saber & the bottom is thermal detonator or what ever order you choose. But that might be a “waste of use” of a very “fancy” button ? Like you said:
Anyways, thank you for reading my (long) post. Hope you recover from your jet-lag quickly.
Expending what was created by others, that I can see but creating from scratch is not my forte.
P.S.: My trick to combat jet-lag as quickly as possible (I travel a lot for work) for flights from EU to US. or Far-East to EU.
- If you arrive in daytime, take a nap but not more than 2-3 hours (set at least 2 alarms 5 minutes apart, the second alarm out of reach from the bed) and kick yourself out of bed if you have to.
- go out with some friends or colleagues and have dinner.
- go to bed at normal time or at least no too late.
- next day back to normal schedule and no nap.
From US to EU is a bit harder but: - Go out and drink a bit more than usual so you can go sleep at a time when your body/brain doesn’t want to.
- Wake up for breakfast with 2 alarms like above.
- If needed, take a nap not longer than 2-3 hours.
- Go out for dinner with friends or colleagues
- Go to bed at normal time.
Hope it helps.
P.P.S.: Maybe this post should/could be moved to a new “multi_prop” thread ?