Getting Started Cameras & Video Detection & Recording Automation & Events Actions Integration & Connectivity Network & Discovery AI & Remote Control MQTT Modbus Pi4J & Raspberry Pi GPIO ZeroMQ System & Administration Comparisons Use Cases Troubleshooting About & Legal
Home / Documentation / Pi4J GPIO
Thing ยท Pi4J 2.0.0

Raspberry Pi GPIO with Pi4J

Creates the Pi4J context, persists GPIO configuration, polls digital inputs, controls digital and PWM outputs, and generates pin-state events.

ParameterDescriptionDefault
Board modelRaspberry Pi 40-pin or 26-pin header.40 pin
Poll intervalDigital-input polling interval, 50โ€“10000 ms.200 ms
Platform / providersAutomatic or forced platform and GPIO provider selection.Auto detect
Linux PWM chip0 for Pi 0โ€“4; 2 for Pi 5 RP1.0
Auto inject / shutdown hookPi4J context lifecycle settings.Enabled
Electrical safety: GPIO uses 3.3 V logic. Use drivers, isolation, and external power for relays, motors, servos, and other loads.
SENSE

Digital sensors

Poll buttons, contacts, and sensors and route changes through Event Manager.

CTRL

GPIO and PWM control

Switch isolated inputs or control servos, dimmers, fans, and motor drivers.

PAD

Gamepad control

Map two controller axes to PWM pins for pan/tilt, steering, or throttle.

readBoard
Returns the header and configured pins.
read*PinListDropdown
Lists all, digital-output, or PWM pins.
configurePin / deletePin
Persists or removes a pin.
setPinState / setPwm
Controls a digital or PWM output.

Pi4JPinStateEvent

Contains BCM number, digital state, and the complete pin snapshot with mode, pull resistor, PWM settings, and last error.