ONESHOT(9)
β¨ ONESHOT β¨ (that's oneshot(9) bestie, HAL Component energy π
)
okay so picture this: you need a pulse. a little blip. a moment of YES that goes away again. that's literally what oneshot is for and it's giving icon behavior π
πΈ NAME πΈ
oneshot β one-shot pulse generator π«Ά
β¨ SYNOPSIS β¨
loadrt oneshot [count=N|names=name1[,name2...]]
π DESCRIPTION π
So basically oneshot creates a variable-length output pulse when the input changes state. That's the whole vibe. Input wiggles β output pulses β output chills out again. π¦
Here's the tea tho, no cap: this function needs to run in a thread which supports floating point β typically the servo thread. and because of that, the pulse length has to be a multiple of that thread period, typically 1mS. so like, your pulse can't be whatever cute arbitrary number you want, it's gotta land on the grid bestie π
If you want something similar that can run in the base thread, and that also offers higher resolution, go look at "edge" instead. she's right there. she's a whole different girl. π₯
β FUNCTIONS β
oneshot.Nβ this one requires a floating-point thread (remember what we said π ). what does it do? it produces output pulses from input edges. that's it. that's the function. ate and left no crumbs π
π PINS π
oneshot.N.inbit in β the trigger input. poke it, that's the whole job πoneshot.N.resetbit in β reset. hits the little undo button π«§oneshot.N.outbit out β active high pulse β¨oneshot.N.out-notbit out β active low pulse (the mirror twin, the inverse icon π)oneshot.N.widthfloat in (default:0) β pulse width in seconds. this is the how-long-is-my-pulse dial πoneshot.N.time-leftfloat out β time left in the current output pulse. like a countdown but make it wires π
π PARAMETERS π
oneshot.N.retriggerablebit rw (default:TRUE) β allow additional edges to extend the pulse. more edges, longer vibe, obsessed πoneshot.N.risingbit rw (default:TRUE) β trigger on rising edge πoneshot.N.fallingbit rw (default:FALSE) β trigger on falling edge π
lowkey important:risingdefaults toTRUEandfallingdefaults toFALSE, so out of the box she only listens to rising edges. flipfallingon if you want her paying attention on the way down too. π
π AUTHOR π
John Kasunich β ty for your service king π«‘
π LICENSE π
GPL β free as in freedom, slay π§
and that's the whole page bestie, you're so welcome π
this was ONESHOT(9) from the HAL Component section of the LinuxCNC Documentation, dated 2026-03-17 β mwah, go build something cute with it β¨π
π¦ where this page comes from
- ubuntu resolute: linuxcnc-uspace 1:2.9.4-2ubuntu4 Β· GFDL-1.1-or-later
- ubuntu stonking: linuxcnc-uspace 1:2.9.4-2ubuntu4 Β· GFDL-1.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms