Skip to main content

DIO

The DIO node controls a general-purpose digital input or output pin. Input pins support hardware interrupts for immediate edge detection.

Configuration​

dio:
enabled: true
sensors: ["limit_switch", "estop"]
limit_switch:
pin: 15
type: "input"
interrupt_edge: "none"
estop:
pin: 10
type: "input"
interrupt_edge: "rising"
debounce_ms: 20

Parameters​

ParameterDescription
pinDIO channel (range 0 – 21)
type"input" or "output"
interrupt_edge"none", "rising", or "falling" — input mode only
debounce_msDebounce time in milliseconds — optional, input mode only

Button Wiring​

All input pins have internal pull-ups. Wire buttons between the pin and GND.

Contact TypeRecommended EdgeReason
NO (Normally Open)"falling"Pin goes low when pressed
NC (Normally Closed)"rising"Fail-safe — detects open circuit
tip

When you set interrupt_edge, a hardware interrupt fires immediately on the detected edge, alongside the regular 10 Hz poll.

Topics​

Published​

TopicTypeDescriptionRate
/<name>/statestd_msgs/BoolCurrent pin state10 Hz + on interrupt

Subscribed​

TopicTypeDescription
/<name>/cmdstd_msgs/BoolSet pin high (true) or low (false) — output mode only

Service​

Service name: /<name>/dio_cmd
Type: studica_control/SetData

CommandDescription
toggleFlip the output state — output mode only