Trying to come up with a cleaner version to cycle inputs

21 views
Skip to first unread message

SteamyBiscuit

unread,
Jun 8, 2026, 4:49:20 PM (3 days ago) Jun 8
to QuadStick
I'm trying to come up with a cleaner version of my Tactical strafing that involves three different modes and compressing it down to only two modes

I had an idea of using Duty with two parameters within two modes maximum
But I think constant is breaking the rules of changing how functions work I need ideas please and thank you. 

While activating center puff it's supposed to activate A And once it changes modes the QS takes over still activating A As well as simultaneously activating B Cycling between both of them




Fred Davison

unread,
Jun 8, 2026, 5:59:06 PM (3 days ago) Jun 8
to SteamyBiscuit, QuadStick
The duty cycle function scales an analog input value into an on/off cycle that has the percentage of the output on time be proportional to the analog input value.  If the input was value was low, the proportion of the on time would be low and the output would be off most of the time.  If the input value was high, then most of the time the output would be on and only be off for a short time.

If there is no second parameter, it is by default set to 1/2 the value of the first parameter.  With both parameters set to 1000, the function is being told to scale the analog input into a pulse that is one second long, but cannot be on for less than one second OR off for less than one second.  The way the math works, to maintain a minimum off time, it is going to stretch the cycle time out to maintain the minimum on/off times.   A value of greater than one-half the first parameter was not expected.

The second parameter being the same as the first parameter is not really a situation that was ever envisioned when the function was written.  It could produce some strange edge case behavior.  It might even produce a divide by zero exception in the math.  The output must be both on and off for a minimum of one second, which would take at least two seconds.  It will then try to stretch the time of the cycle to be longer.

The only time I used it was in driving vehicles that were driven by keyboard presses:

kb_wduty 60up
kb_aduty 60left
kb_sduty 60down
kb_dduty 60right

It would quickly press and release the keys to steer and control the gas/brake pedals in a jerky but usable manner.  

I'm not at all sure how that function will behave in these rows:

image.png

When the center sip goes above the hard threshold, it will barely be on, 0.1%.  You would need to sip much harder to get the Y output to be on most of the time. 

The other thing is "constant" is not really an analog input.  It is 100% all the time.  It doesn't really go with a function that is intended to dynamically scale the timing of a joystick into quick key presses.

If anyone can find a use for it, it will be you.  You have found diabolically clever ways of using the output functions before.


--
You received this message because you are subscribed to the Google Groups "QuadStick" group.
To unsubscribe from this group and stop receiving emails from it, send an email to quadstick+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/quadstick/0c56963b-cec1-48b8-9b48-486a5ccecfe9n%40googlegroups.com.

SteamyBiscuit

unread,
Jun 9, 2026, 4:03:49 PM (2 days ago) Jun 9
to QuadStick
Hi thanks for the detailed description I'll see what I can come up with👍
Reply all
Reply to author
Forward
0 new messages