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​
| Parameter | Description |
|---|---|
pin | DIO channel (range 0 – 21) |
type | "input" or "output" |
interrupt_edge | "none", "rising", or "falling" — input mode only |
debounce_ms | Debounce time in milliseconds — optional, input mode only |
Button Wiring​
All input pins have internal pull-ups. Wire buttons between the pin and GND.
| Contact Type | Recommended Edge | Reason |
|---|---|---|
| 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​
| Topic | Type | Description | Rate |
|---|---|---|---|
/<name>/state | std_msgs/Bool | Current pin state | 10 Hz + on interrupt |
Subscribed​
| Topic | Type | Description |
|---|---|---|
/<name>/cmd | std_msgs/Bool | Set pin high (true) or low (false) — output mode only |
Service​
Service name: /<name>/dio_cmd
Type: studica_control/SetData
| Command | Description |
|---|---|
toggle | Flip the output state — output mode only |