Help with pulse function formula

16 views
Skip to first unread message

Chris Davidson

unread,
Sep 17, 2025, 7:40:44 AMSep 17
to QuadStick
What would the formula be for a button to pulse 20 times per second for 5 seconds? pulse 50 50?

RG RE-GAMER

unread,
Sep 17, 2025, 7:49:19 AMSep 17
to QuadStick
5000 100

Fred Davison

unread,
Sep 17, 2025, 2:03:21 PMSep 17
to Chris Davidson, QuadStick
The way the pulse function works is the first parameter controls the pulse width and the second controls the number of pulses.  If there is more than one pulse, the on time and off time of each pulse will be the first parameter.

If you had a one second pulse, with two pulses, the output would go on for one second, off for one second, then back on for one second.

A twentieth of a second is 50 ms, but to complete a full on/off cycle in 50 ms, the pulse width needs to be half of that, or 25 ms.   Each pulse will go on for 25 ms, off for 25 ms, then repeat.  Five seconds worth would be 100 pulses

pulse 25 100

BTW, 20 times per second is not humanly possible and can get your account flagged as a bot or as using a device like the Cronus Zen in some games, so be careful where you use it.



RG RE-GAMER

unread,
Sep 17, 2025, 6:45:04 PMSep 17
to QuadStick
Sorry Chris, i i am wrong.
Reply all
Reply to author
Forward
0 new messages