
Announcing the Pi4J project!
This project is intended to provide a bridge between the native hardware and Java for full access to the Raspberry Pi in with a Java-friendly object-oriented approach. Pi4J is an open source project developed by professional software engineers. In addition to the basic raw hardware access functionality, this project also attempts to provide a set of advanced features that make working with the Raspberry Pi an easy to implement and more convenient experience for Java developers.
Project Website: http://www.pi4j.com
Source Repository: https://github.com/Pi4J/pi4j
Basic Features
- Export & unexport GPIO pins
Configure GPIO pin direction
Configure GPIO pin edge detection
Control/write/set GPIO pin states
Read GPIO pin states
Send & receive data via RS232 serial communication
- Pulse GPIO pin states
Listen for GPIO pin state changes (interrupt-based events; not polling)
Automatically set GPIO states on program termination (GPIO shutdown)
Triggers for automation based on pin state changes
Access system information and network information from the Raspberry Pi
Wrapper classes for direct access to WiringPi Library from Java
To get started using the Pi4J library, please see the Usage page and review each of the examples below to explore the functionality provided by the Pi4j library.
- Control GPIO
Listen for GPIO Events
Shutdown GPIO
Trigger GPIO on Events
Serial Communication
System/Network Information
This project uses Gordon's Wiring Pi native library under the hood. Pi4J also exposed a direct JNI wrapper of static methods around the Wiring Pi functions if you prefer to go the low-level route.
Please let us know what you think about the project! Let us know if there is anything missing or that can be improved on.
Thanks!