B4J Question pi4j2 problem with versioning

jayel

Active Member
Licensed User
Longtime User
Hello

I want to use pi4j2 as pi4j isn't supported anymore.
I dowloaded https://www.b4x.com/android/forum/threads/pi4j2-raspberry-pi-i-o-library.136113/#content

When I run the simple sample solution from Erel I get :

I updated with sudo apt intstall default.jdk
What could be wrong?
 

jayel

Active Member
Licensed User
Longtime User
I found that I have to run :
sudo apt-get install pigpio

And now I don't get any error but no detection of the pushbutton on the piface IO board.


Push button:
'Non-UI application (console / server application)
#Region Project Attributes
    #CommandLineArgs:
    #MergeLibraries: True
#End Region

Sub Process_Globals
    Private pi4j As Pi4J
    Private PinIn As DigitalInput
End Sub

Sub AppStart (Args() As String)
    Log("Hello world!!!")
    Start
    StartMessageLoop
End Sub
Private Sub Start
    pi4j.Initialize("pi4j")
    PinIn.Initialize(pi4j, "PinIn", 2, "PULL_DOWN", 3000)
End Sub
Private Sub PinIn_StateChange (State As Boolean)
    Log("New state: " & State)
End Sub
Do I have to enable something els besides the SPI?
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…