GPIO Toolkit
Control Raspberry Pi GPIO pins with read, write, edge watching, and software PWM. Compatible with Pi 5 (chip 4) and Pi 4 (chip 0). Requiresnode-libgpiod as an optional peer dependency.
Quick Start
Config
GPIO chip number. Use
4 for Pi 5, 0 for Pi 4 and earlier.Allowlist of pin numbers. Empty array = all pins allowed.
Maximum software PWM frequency in Hz.
Tools
| Tool | Description |
|---|---|
gpio_read | Read the current state (0 or 1) of a pin |
gpio_write | Set a pin to HIGH (1) or LOW (0) |
gpio_watch | Watch for rising/falling edge changes |
gpio_pwm | Software PWM for LEDs, buzzers, or servos |
Safety
TheallowedPins config restricts which pins the agent can access, preventing accidental writes to system-critical pins.