Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [pi4j]

Pi4J is a library for Java to use the GPIOs of the Raspberry Pi.

0
votes
0answers
12 views

BTS7960 pwm values

I have a BTS7960 h-bridge and I am trying to make a motor to move forward and backward using pwm values. I am using the pi4j library to control the pins. The pins L_EN and R_EN are initialized as ...
0
votes
1answer
24 views

My Raspberry Pi B+ has the Ri 2 B pinmap

I trying out different java programs for my RPi B+ V1.2 and as far I have only tried to blink with a lamp for a few seconds. It works. Now I want to try to blink with a lamp by using a button. In ...
0
votes
0answers
35 views

I cannot compile Java code with Pi4J library - java.lang.UnsatisfiedLinkError

I tried to compile Java code on Ubuntu 18.04. I'm trying to use Remote JDK so I can compile on my local computer and then send the compiled code to my Raspberry Pi. But I having som trouble with ...
0
votes
0answers
22 views

I wan't to develop Java code on my Raspberry Pi by using VNC-server - Very slow 100%

I'm using Raspbian Lite on my Raspberry Pi B+ 1.2. I have SSH enabled so I could install VNC-server on my RPi. When I start up my Raspberry Pi B+ it's very very slow. Something is wrong. The memory ...
0
votes
1answer
84 views

How to restart the GPIO after shutdown() called

After I call the following Java code: gpio.shutdown() The GPIO turns off. How can I restart it? I need to restart it because of this problem. In the problem the light does not turn off with led.low(...
0
votes
3answers
71 views

provisionDigitalOutputPin sets mode to high low() and blink() don't work

I have the following Java program to turn off the LED connected to wiringpi GPIO_07 at start, then blink based on user input. import com.pi4j.io.gpio.GpioController; import com.pi4j.io.gpio....
0
votes
0answers
10 views

How to do Maven build of Raspberry code on MacBook

While trying to do maven build on MacBook for Raspberry Pi 3 B+ board I am getting the following errors (I have written a simple program using pi4j library). The problem is while linking dynamic .so ...
2
votes
0answers
156 views

PI4J + Adafruit LCD with MCP23017

Got this device. Python example char_lcd_plate.py is working perfect. But I would like to manage it with Pi4J. I copied bits from python example LCD_PLATE_RS = 15 LCD_PLATE_RW ...
0
votes
0answers
18 views

Raspberry Pi piface pi4j java

I am new to raspberry pi and am trying to use pi4j library to run one of the java samples of pi4j provided. When I issue gpio commandline on my pi, I am able to set the output high or low on the ...
0
votes
2answers
89 views

pi4j implementation for SPI communications with MCP3008 reading zeros

I have hardwired a MCP3008 IC into the SPI input on a Raspberry Pi3. MCP3008 is wired as follows: pin 10 (CS) to Pi GPIO_10 (pin 24) this is CE0 pin 11 (Din) to Pi GPIO_12 (pin 19) this is MOSI ...
0
votes
0answers
85 views

GPIO listener on Compute module 3 Pi4J

I am doing a project where I use a compute module 3 with Raspbian Jessi Lite, Java with the Pi4J lib version 1.2-SNAPSHOT. I'm trying to implement a GpioPinListenerDigital on the GPIO_23 like so: ...
0
votes
0answers
53 views

Weird issue receiving data from Serial through Usb Converter

I'm developing a project whose main goal is collecting several data and storing it in a database. A raspberry pi is deployed within a vehicle and it's running a Java application. The goal is to ...
0
votes
1answer
485 views

JavaFX on Raspberry PI 3 (Fullscreen/Black Bars)

I have Raspbian installed on my Pi 3. I am trying to develop a JavaFX application which needs to send and receive data over serial interface so I use PI4J. Now i have a few problems when running this ...
0
votes
2answers
221 views

When to set internal pin resistance at software layer

I'm trying to wire my Raspbery Pi 1 Model A (hereafter RPi) to a simple 6VDC buzzer and here is my best attempt: So the 3.3V power pin from the RPi is connected to the breadboard's top-most rail via ...
0
votes
0answers
150 views

cannot play sounds on RPI3-B with java

im creating a java game library with support for raspberry, on that library I have a class that is in charge of sound effects, I created a game to test GPIO pins and sound was not working, I got an ...
0
votes
1answer
314 views

Pi4J | SPI | Gpio-Pin as Chip Select

I am using Pi4J to write programs on my Raspberry Pi. The Raspi is supposed to communicate with an Arduino Uno via SPI. It works pretty good, but there are only two SpiChannels so there are also only ...
6
votes
2answers
275 views

Pi4J kills USB bus?

Hello fellow Pi enthusiasts :) I am currently attempting to control a standard 16x2 character LCD display from the PI's GPIO pins from Java. I downloaded Pi4J and wrote a small program to initialize ...
0
votes
1answer
164 views

GPIO works on PI Model B but does not work on PI 3 Model B

Something very unusual is happening here. I wrote a program in Java (using Pi4J) to blink a led (to debug the problem). testPin = gpio.provisionDigitalOutputPin(RaspiPin.GPIO_01,"TEST",PinState.HIGH)...
0
votes
0answers
69 views

Can't load Raspberry Pi example listener

The code provided by raspberry as example doesn't work, and I can't find information about this error. Could someone tell me what's going on. I did like they said there so first install, after search ...
0
votes
0answers
628 views

Sense Hat with Java

Does anyone know how I can use the raspberry pi sense hat with java? I am aware of pi4j, but I don't know how to use it to communicate with the sense hat. Does anyone have any idea how it could be ...
1
vote
0answers
447 views

GPIO State Listener Example using Pi4J permanently triggers LOW-event

I have a Pi3 and I am trying out the example http://pi4j.com/example/listener.html which is a GPIO state listener. My issue is the following: When I press (close) the contact, I get one HIGH event. ...
0
votes
0answers
262 views

WiringPi still asks for root

After a couple of days trying to setup everything and hitting this issue, I give up. Using tomcat to run an app that will use PI4J to control SPI and GPIO ports. Trying to do GpioUtil....
1
vote
2answers
516 views

Software Flow Control in Serial communication

I am using java/pi4j to for serial port in raspberry pi (Raspbian OS) to connect it to a device which has serial port. I am wondering is it possible to use software flow control (xonxoff) in my ...
1
vote
2answers
276 views

Pi4J ESC brushless motor is not running stable

I would like to control a brushless motor with a Java program running on a Raspberry Pi model b+. This is the code that I am using: package de.ye.boat_eng; import com.pi4j.wiringpi.Gpio; import com....
3
votes
1answer
428 views

How to use PI4J with a brushless motor?

I have a Raspberry Pi 2 model B. I would like to be able to control a motor with a regulator and PI4J. I put the black cable to a ground pin and the PWM pin to pin 26. I've worked with servos before, ...
3
votes
2answers
313 views

RejectedExecutionException in pi4j

I have a Java program that is using pi4j project to interact with the GPIOs. I have one test class that listens for a button to be pressed and then does something. The class is part of many in a ...
3
votes
0answers
1k views

Pi4J and Mifare RC-522 via SPI

I am having problems with coding a program that allows me to read RFID Tags with Pi4J on my Raspberry Pi 2 Model B. I am totally new to Python and would prefer a program written in Java to save some ...
2
votes
2answers
4k views

Java and DS18B20

I want to read temperature from DS18B20 sensors. Sensors are connected and works fine. How can I read temperature using Pi4J? Is there API for this?
3
votes
1answer
314 views

Output Accurate, Detailed PWM signal

I'm building a quadcopter using the RPI 2 Model B. I'm currently using the Pi4J library (Java library that wraps the WiringPi library) for my project. All is going well except my ESC (Electronic Speed ...
4
votes
1answer
245 views

Why is my LED display code so slow?

I have a Raspberry Pi 2 and I am trying to create an led display for it from scratch. It works.. but the refresh is far to slow. My project is running very very slow averaging around 21 ms per ...
17
votes
1answer
9k views

Do all GPIO pins have a internal pull-up/pull-down resistors?

So question is: Does all Raspberrys GPIO have a internal pull-up/pull-down resistor which can be enabled from program, in my case Java language with PiJ4? I have Raspberry Model B+.
1
vote
1answer
722 views

Java Servlets and Raspberry Pi IO

I'm trying to learn how to write simple servlets to use with a Raspberry Pi. I want to control the board I/O via web.I'm using the Pi4J library which is a wrapper for the WiringPi C library.It works ...
0
votes
1answer
337 views

Issues with Shift Registers and 8-Channel Relay on the Pi

Ok, been puzzled about this problem I have. So I've hooked up my 8-channel relay on the shift register (SN74HC595N) and I'm trying to simulate a simple on-off sequence for testing (using pi4j). So ...
1
vote
0answers
258 views

Increase Performance of 4x4 LED Matrix (Multiplexing with pi4j)

I have coded a Display-Class to drive a X by Y LED-Multiplexing-Matrix with pi4j. However, I when driving a 4-by-4-Matrix I cannot get the framerate beyond roughly 30 fps, which still produces a ...
0
votes
1answer
277 views

Gpio state can't be changed when connected to a DC motor or led

I am using the pi4j library to control the gpios on the raspberry pi B, but I ran in the following problem: when I start a pi4j example like ControlGpioExample.java then the led(with resistor 220 ohm) ...
3
votes
2answers
681 views

Native C access to wiringPi from PI4J

I appreciate the PI4J project and the access it provides to GPIO from Java (my language of choice) however, compared to C, Java is much slower. Normally this is not a problem but I was working with ...
1
vote
2answers
2k views

Running a JAR file in Pi results in following error “can't find the main class”

I want to make a GUI application in java which can control the gpio pins. I used pi4j lib for control the pins. I wrote a pin toggle code inside the button click event as shown below. while running ...
1
vote
1answer
764 views

I created a GUI with gpio access in java and tested sucessfully in netbeans IDE. But when I runs in Raspberry pi it showing the following error

following image showing the error while running the JAVA GUI application.I use the following command to run the jar file by adding class path of the pi4j lib.
1
vote
1answer
725 views

How can I use Pi4J as a non-root user?

I am writing a large program, with some use of Maven to manage dependencies, and have come across the issue that running Pi4J causes /dev/mem to be opened, which, of course, cannot be done by a non-...
1
vote
3answers
5k views

PI4J: Multi-threading when listening to Pin Interrupt events

Currently I'm working on a application for my RPi which will be monitoring a set of GPIOs in real-time where the exact time when the GPIO turns HIGH is crucial for my application. The actual date is ...
3
votes
1answer
627 views

pi4j provisionDigitalOutputPin without setting state low

How can I? I want to run a program every few minutes with cron. I read a file of times that I expect pins on or off and then check the state of each pin and set them accordingly. It works fine ...
2
votes
1answer
2k views

Ultrasonic sensor get distance with java

I use this script http://devilqube.blogspot.nl/2013/02/using-ultrasonic-range-finder-with.html to get values from my ultrasonic sensor. When I run the code and print the distances it results in a lot ...
2
votes
1answer
979 views

Using PI4J to toggle a led on a breadboard

Since yesterday I been trying to figure out how to turn on a led on and off, my problem is that Pi4J (from what I can see) only takes up to 20 GPIO inputs and my breadboard is set to 30 and from a to ...
1
vote
1answer
2k views

Pi4J - Changing GPIOs from and to Input, Low and High

I am trying to create something which uses Charlieplexing, and to use it, I need to be able to turn GPIO Pins to and from different states (Low, High and Input) from what I understand from this video: ...
2
votes
1answer
3k views

RaspberryPi MOSI/MISO on java with PI4J

Sorry for my English, but I will try :) I need help with working with RFID reader RC522 (like this). I connected it to Pi with help of this manual, but I cant write right code on Java and Pi4J, which ...
1
vote
2answers
2k views

Raspberry pi cannot read from GPIO using pi4J

I am running the code at the bottom using java and Pi4j library, pretty much the program checks is the pin is low and waits sometime before turning off the tv. When I reboot my Raspberry and run the ...