Machinekit Documentation
HAL Component — ONESHOT
INSTANTIABLE COMPONENTS — General
All instantiable components can be loaded in two manners
Using loadrt with or without count= | names= parameters as per legacy components
Using newinst, which names the instance and allows further parameters and arguments
primarily pincount= which can set the number of pins created for that instance (where applicable)
NAME
oneshot — one-shot pulse generator
SYNOPSIS
oneshot
USAGE SYNOPSIS
loadrt oneshot
OR
newinst oneshot <newinstname> [ pincount=N | iprefix=prefix ] [instanceparamX=X | argX=X ]
( args in [ ] denote possible args and parameters, may not be used in all components )
DESCRIPTION
creates a variable-length output pulse when the input changes state. This function needs to run in a thread which supports floating point (typically the servo thread). This means that the pulse length has to be a multiple of that thread period, typically 1mS. For a similar function that can run in the base thread, and which offers higher resolution, see "edge".
FUNCTIONS
oneshot.N.funct ( OR <newinstname>.funct (requires a floating-point thread) )
Produce output pulses from input edges
PINS
oneshot.N.in bit in ( OR <newinstname>.in bit in ) - Trigger input
oneshot.N.out bit out ( OR <newinstname>.out bit out ) - Active high pulse
oneshot.N.out-not bit out ( OR <newinstname>.out-not bit out ) - Active low pulse
oneshot.N.width float in (default: 0) ( OR <newinstname>.width float in (default: 0) ) - Pulse width in seconds
oneshot.N.time-left float out ( OR <newinstname>.time-left float out ) - Time left in current output pulse
oneshot.N.retriggerable bit in (default: true) ( OR <newinstname>.retriggerable bit in (default: true) ) - Allow additional edges to extend pulse
oneshot.N.rising bit in (default: true) ( OR <newinstname>.rising bit in (default: true) ) - Trigger on rising edge
oneshot.N.falling bit in (default: false) ( OR <newinstname>.falling bit in (default: false) ) - Trigger on falling edge
LICENCE
GPL