1

What Java library should I use to control raspberry pi 4b, Pi4J does not support rpi4. Wiringpi is deprecated. I tried searching for others b ut cannot find anything, how to control gpio with java in 2020?

Ghanima
  • 15,958
  • 17
  • 65
  • 125
newbie
  • 31
  • 1
  • 4

4 Answers4

3

I can confirm that diozero (documentation now at https://www.diozero.com/) works with all flavours of Raspberry Pi, from the armv6 based Pi Zero through to the latest Pi4 / Compute Module 4, as well as many other SBCs (tested on Odroid C2, Beaglebone Green/Black, TinkerBoard, NanoPi Neo/Duo2). Also works on both 32-bit and 64-bit operating systems (Raspberry Pi OS, Armbian and Ubuntu). Finally, it also works with Arduino devices using Firmata.

1

Different possibilities...

Frank
  • 328
  • 1
  • 9
0

They have new version of Pi4J V.2 with Java 11, support RPI 4 B+. Pi4J V.2 had the first release in August 2021. So, go do it !

Pi4J 2.0

0

If you would like to have pure modern Java 22+ approach with zero dependency, you can try https://github.com/DigitalSmile/gpio

It uses new FFM API to interact with hardware and linux syscall.

I am the author, feel free to ask questions or contribute.