Drivers for various electronic components, using the Pi4J library
Find a file
Stefan Haustein d4241e6908
Merge pull request #100 from kobjects/main
Add SPI support for the ssd1306 driver
2025-12-06 15:44:50 +01:00
.github/workflows Migrate 24 in hidden files to 25 2025-09-27 20:41:08 +02:00
.mvn/wrapper Initial commit 2025-08-19 12:27:55 +02:00
config/checkstyle Added checkstyle plugin 2025-08-20 11:37:27 +02:00
docs VideoDisplay Driver for st7789. 2025-08-20 10:10:09 -04:00
src Merge branch 'main' into main 2025-12-06 15:29:46 +01:00
.gitignore Cleanup gitignore 2025-08-19 20:25:38 +02:00
CONTRIBUTING.md Update CONTRIBUTING.md 2025-10-12 20:52:23 +02:00
LICENSE Initial commit 2025-08-19 12:27:55 +02:00
mvnw Initial commit 2025-08-19 12:27:55 +02:00
mvnw.cmd Initial commit 2025-08-19 12:27:55 +02:00
pom.xml disable ffm, as it seems to break tests 2025-11-09 17:35:55 +01:00
README.md Update README with coverage state link 2025-11-23 17:26:10 +01:00

Pi4J :: Drivers

GitHub Actions: Maven build

THIS IS THE VERY START OF A NEW PROJECT. NO USABLE CODE IS YET AVAILABLE.

This project contains driver implementations for various electronic components, using Pi4J V4+. Full description will be available on the Pi4J website at Documentation > Using Drivers.

For the current coverage state and plans, please refer to https://docs.google.com/document/d/1Gyeaq6xCbvmE-ZH675zyYz2Jhhc-76IA5tvJtxvjmbE/edit?usp=sharing

Using this Library

As this is library is still in early stage, you can only get a SNAPSHOT-version. To be able to use it in your project, you'll need to add both the dependency, and allow SNAPSHOTs:

<dependencies>
   ...
   <dependency>
      <groupId>com.pi4j</groupId>
      <artifactId>pi4j-drivers</artifactId>
      <version>0.0.1-SNAPSHOT</version>
   </dependency>
   ...
</dependencies>

<repositories>
   <!-- Non-snapshot Maven libraries + Pi4J Core snapshots -->
   <repository>
      <id>oss-snapshots-repo</id>
      <name>Sonatype OSS Maven Repository</name>
      <url>https://oss.sonatype.org/content/groups/public</url>
      <releases>
         <enabled>false</enabled>
      </releases>
      <snapshots>
         <enabled>true</enabled>
      </snapshots>
   </repository>
   
   <!-- Pi4J Drivers snapshots -->
   <repository>
      <id>oss-snapshots-M2-repo</id>
      <name>Sonatype OSS Maven2 Repository</name>
      <url>https://central.sonatype.com/repository/maven-snapshots</url>
   </repository>
</repositories>

The Case for A Pi4j “driver” Subproject

Document created by Stefan Haustein.

Background

Pi4J used to have a set of iot hardware drivers, but they have been removed from the main project due to maintenance issues. Currently, there is the pi4j-example-devices subproject containing drivers.

The examples cover several common devices and show how to use Pi4J to communicate with devices, but they are not suitable for external projects to “just” depend on.

Proposal

The proposal here is to insert a new subproject pi4j-drivers, so the dependency structure for pi4j-example-devices is as follows:

pi4j
|
pi4j-drivers
|
pi4j-example-devices

Ideally, this would not lead to an expansion of code size. Instead, drivers that are converted by the pi4j-drivers subproject will be deleted in the example-devices project keeping the examples in place.

Examples for the pi4j-drivers project will be contained in the pi4j-example-devices project.

The drivers project will allow users to use covered hardware in a straightforward way, taking advantage of modern build / dependency management to keep them up to date.

Volunteers

  • @eitch
    • Proper release management
  • @stefanhaustein
    • Contribute a set of drivers (currently have Bmx280Driver.java and Scd4xDriver.java and can offer a PiXtendDriver if there is interest, but its a bit more “esoteric”; would also like to add a character lcd driver after some more cleanup).
    • Would be willing to take part in ownership, i.e guide contributors / do code review
    • Would be willing to write PRs for removing redundant code from pi4j-example-devices
  • @fdelporte
    • Documentation on the Pi4J website
  • Many others volunteered to contribute their existing driver implementations

CONTRIBUTING

Please refer to CONTRIBUTING.md.

BUILD DEPENDENCIES & INSTRUCTIONS

This project can be built with Maven.

LICENSE

Pi4J is licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.