SYNOPSIS
loadrt momentary2nist [count=N|names=name1[,name2…]]
DESCRIPTION
Momentary2nist can be used with a momentary push button to control a device that has separate on and off inputs and an is-on output. A debounce delay in cycles can be set for in. (default = 2) A maximum output pulse length in cycles can be set for on and off. (default = 100)
-
On a rising edge on pin in when is-on is low: It sets on until is-on becomes high.
-
On a rising edge on pin in when is-on is high: It sets off until is-on becomes low.
-
Pins on and off remain high until is-on confirms the respective state or until max-pulse-length is reached.
┐ ┌─────xxxxxxxxxxxx┐ ┌─────xxxxxxxxxxxx┐
in : └─────┘ xxxxxxxxxxxx└───────────┘ xxxxxxxxxxxx└─────
┐ ┌───────────┐
on : └─────┘ └─────────────────────────────────────────
┐ ┌───────────┐
off : └───────────────────────────────────┘ └───────────
┐ ┌─────────────────────────────┐
is-on: └─────────────────┘ └───────────
FUNCTIONS
- momentary2nist.N
PINS
- momentary2nist.N.in bool in
-
momentary button in
- momentary2nist.N.is-on bool in
-
current state of device
- momentary2nist.N.debounce ui32 in (default: 2)
-
debounce delay for in-pin in cycles
- momentary2nist.N.max-pulse-length ui32 in (default: 100)
-
max output pulse length
- momentary2nist.N.on bool out
-
turn device on
- momentary2nist.N.off bool out
-
turn device off
AUTHOR
David Mueller
LICENSE
GPL