I'm trying to update data on a screen when buttons are pressed, but the buttons whont be registered as pressed according to Pi4j
button initialization:
button1 = pi4j.create(DigitalInput.newConfigBuilder(pi4j)
.id("button")
.name("button 1")
.address(GPIOPin.GPIO27)
.pull(PullResistance.PULL_DOWN)
.debounce(3000L)
.provider("linuxfs-digital-input")
);
button2 = pi4j.create(DigitalInput.newConfigBuilder(pi4j)
.id("button1")
.name("button 2")
.address(GPIOPin.GPIO22)
.pull(PullResistance.PULL_DOWN)
.debounce(3000L)
.provider("linuxfs-digital-input")
);
button3 = pi4j.create(DigitalInput.newConfigBuilder(pi4j)
.id("button2")
.name("button 3")
.address(GPIOPin.GPIO23)
.pull(PullResistance.PULL_DOWN)
.debounce(3000L)
.provider("linuxfs-digital-input")
);
home = pi4j.create(DigitalInput.newConfigBuilder(pi4j)
.id("button3")
.name("button home")
.address(GPIOPin.GPIO17)
.pull(PullResistance.PULL_DOWN)
.debounce(3000L)
.provider("linuxfs-digital-input")
);
I read the state of the buttons using the DigitalInput#isHigh() and DigitalInput#isLow() methods in a javax.swing.Timer
The timer is defined as a field and the java.awt.event.ActionListener is provided on the definition of the Timer.
The timer is started after the buttons have ben defined.
Build.gradle dependencies include com.pi4j:pi4j-plugin-linuxfs:2.3.0
Physical setup:

links to the code parts:
button setup
Timer forn the button reads
Build.gradle dependencies
If more information is needed I will be glad to try to provide it.
I'm trying to update data on a screen when buttons are pressed, but the buttons whont be registered as pressed according to Pi4j
button initialization:
I read the state of the buttons using the
DigitalInput#isHigh()andDigitalInput#isLow()methods in ajavax.swing.TimerThe timer is defined as a field and the
java.awt.event.ActionListeneris provided on the definition of the Timer.The timer is started after the buttons have ben defined.
Build.gradle dependencies include
com.pi4j:pi4j-plugin-linuxfs:2.3.0Physical setup:

links to the code parts:
button setup
Timer forn the button reads
Build.gradle dependencies
If more information is needed I will be glad to try to provide it.