ONESHOT(9)

πŸ“¦
version 2.9.4 Β· 4 versions
, in ubuntu resolute, ubuntu stonking

✨ 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.in bit in β€” the trigger input. poke it, that's the whole job πŸ“
  • oneshot.N.reset bit in β€” reset. hits the little undo button 🫧
  • oneshot.N.out bit out β€” active high pulse ✨
  • oneshot.N.out-not bit out β€” active low pulse (the mirror twin, the inverse icon πŸ’œ)
  • oneshot.N.width float in (default: 0) β€” pulse width in seconds. this is the how-long-is-my-pulse dial 🌈
  • oneshot.N.time-left float out β€” time left in the current output pulse. like a countdown but make it wires πŸ•

πŸ’œ PARAMETERS πŸ’œ

  • oneshot.N.retriggerable bit rw (default: TRUE) β€” allow additional edges to extend the pulse. more edges, longer vibe, obsessed πŸŒ€
  • oneshot.N.rising bit rw (default: TRUE) β€” trigger on rising edge πŸ“ˆ
  • oneshot.N.falling bit rw (default: FALSE) β€” trigger on falling edge πŸ“‰
lowkey important: rising defaults to TRUE and falling defaults to FALSE, so out of the box she only listens to rising edges. flip falling on 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