Questions tagged [pi4j]

Pi4J intended to provide a friendly object-oriented I/O API and implementation libraries for Java Programmers to access the full I/O capabilities of the Raspberry Pi platform. This project abstracts the low-level native integration and interrupt monitoring to enable Java programmers to focus on implementing their application business logic.

59 questions
6
votes
5 answers

PI4J - Unable to load [libpi4j.so] using path

I'm using NetBeans on MacOS to develop an application using PI4J. Everything looks Ok but I get the error below, saying that PI4J was unable to load. Does anyone know how to solve this? abr 18, 2015 3:02:30 PM com.pi4j.util.NativeLibraryLoader…
Carlos
  • 170
  • 1
  • 3
  • 11
5
votes
6 answers

read temperature from DHT11, using pi4j

I'm trying to read temperature data from a DHT11 temperature sensor, using pi4j. I followed the code written in c and python in this site: http://www.uugear.com/portfolio/dht11-h ... or-module/ But it's not working. when I test the instruction…
4
votes
2 answers

GPIO pin listener in PI using java cause a burst of action event

In this program I can able to read the GPIO pin. But pressing the hardware button(GPIO pin connected with button) for a single event cause a burst of state change and result in burst of action events.. So how can I eliminate the GPIO state change…
Prasanna Anbazhagan
  • 1,693
  • 1
  • 20
  • 37
4
votes
1 answer

Maven project with PI4J library - error in opening zip file

I've got quite strange problem with pi4j library to Raspberry Pi. I have Maven project in Eclipse and just added repository and dependency for pi4j like this: oss-snapshots-repo Sonatype OSS Maven…
yaceq
  • 81
  • 1
  • 6
3
votes
1 answer

pi4j-maven Archetype support via Maven in Intelli Idea

I want to write java code using the dependency Pi4j and using Intellij on Windows 10. The target platform is a Pi Zero W. The instructions to develop on remote (Windows 10 in this case) PC say to add the p4j-maven-archetype but don't explain how to…
Al Grant
  • 2,102
  • 1
  • 26
  • 49
2
votes
1 answer

High frequency GPIO-output from Raspberry Pi 3 using Java

I create for a firma a java game using LibGDX. It will run on a Raspberry Pi 3. It is a clone of a famous arcade cabinet. The game is ready. The joystick control using a port of the evdev library works well. The application will use Pi4j library for…
2
votes
1 answer

How to control adressable RGB leds with raspberryPi in Java

I have a strip of WS2811 adressable RGB leds and I am trying to control them using my raspberry pi. I am programming in java. To access the GPIO I am using a java library called Pi4j (version 1.2; java 8). This version has built-in PWM control. My…
error13660
  • 120
  • 7
2
votes
0 answers

Save image from byte array returned by Raspberry Pi UART Camera

I am currently struggling with getting a picture from a camera connected to the uart circuit of the raspberry pi. I am trying to do so with the aid of pi4j. Since I was able to initialize the camera, I do not think that the problem is related to the…
2
votes
1 answer

Pi4j: SG90 doesn't turn all the way to 180°

I have this SG90 servomotor (completely functional and new) that doesn't turn all the way to 180° (or 0°).It stops halfway when i try to make it go right to left (counterclockwise). I have checked 4 times the wiring and the hardware so the problem…
Akk
  • 53
  • 12
2
votes
1 answer

Run pi4j program on windows or mac

I'm developing a Raspberry PI project using the Java PI4J library. I've got it working correctly on the PI itself but am not able to run my program outside of the PI as PI4J gives errors when it runs. E.g. java.io.IOException: Cannot run program…
Adam
  • 532
  • 3
  • 11
  • 22
1
vote
1 answer

WARNING: "sun.reflect.Reflection.getCallerClass is not supported. This will impact performance"

I receive this warning message in the output of my videogame. The game was tested on Raspberry Pi 3 with 32-bit Raspberry Pi OS and Raspberry Pi 4b with 64-bit Raspberry Pi OS. The game uses Java 11 and root privileges. The game was created using…
1
vote
1 answer

Pi4J v2 SPI w/ GPIO Pin

I'm trying to use Pi4J to talk to an SPI device where the CS pin is a GPIO pin (GPIO 5) and not one of the mapped CS pins. I don't see how to configure it this way in any of the examples or javadocs. I think it would be somewhere on my SpiConfig…
Kevin Seymour
  • 766
  • 9
  • 25
1
vote
2 answers

Raspberry 4 Java Pi4J GPIO Input not changing state

I am trying to use my Raspberry Pi 4's GPIOs to turn on various thing in my smart home. I am getting 2.6V on the GPIO Input, thus resulting in a HIGH signal. I have confirmed this with a basic python script, but since I am better in Java and I want…
Dahlin
  • 157
  • 1
  • 11
1
vote
1 answer

java.net.http import - not found

I am working in Intellij with Java 11. I want to use import java.net.http.httpclient in my project but the import statement is not found. Background: I am compiling on my Windows 10 Workstation to build for deployment on a Rasp Pi Zero W. The…
Al Grant
  • 2,102
  • 1
  • 26
  • 49
1
vote
1 answer

Add a dependency from a maven project to a non-maven project

I'm in the process of writing a java program for a Raspberry Pi where I want to access the GPIO. For this I use the Pi4J-Library Version 2 (https://pi4j.com). As IDE I use Visual Studio Code - as they suggest. In my VSC workspace are included: the…
Joe
  • 53
  • 7
1
2 3 4