Hi, I am trying to program the wiringpi GPIO on reberry pi 4, I connected the rasberry with b4j-bridge.jar and start the program, all function writes "ON" and "OFF" on the log, but it does nothing on the gpio does not turn on no light, the same program run it with Python and the LED works, what of the forum can help me to explain that with the libreie of pi4j it doesn't make the LED update? this is the code
Rasberri pi:
#Region Project Attributes
#MainFormWidth: 600
#MainFormHeight: 600
#MergeLibraries: true
#AdditionalJar: pi4j-core.jar
#AdditionalJar: pi4j-device.jar
#AdditionalJar: pi4j-gpio-extension.jar
#End Region
Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Private Gpio As JavaObject
Dim ledPin As Int = 0
Dim OUTPUT As Int = 1
Dim HIGH As Int = 1
Dim LOW As Int= 0
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
'MainForm.RootPane.LoadLayout("Layout1") 'Load the layout file.
MainForm.Show
Inizzia
End Sub
'Return true to allow the default exceptions handler to handle the uncaught exception.
Sub Application_Error (Error As Exception, StackTrace As String) As Boolean
Return True
End Sub
Public Sub Inizzia
Gpio = Me
Gpio.InitializeStatic("com.pi4j.wiringpi.Gpio")
Private fd As Int = Gpio.RunMethod("wiringPiSetup", Null)
Log(fd)
If fd = 1 Then
Log("Erore")
End If
Gpio.RunMethod("pinMode",Array(ledPin,OUTPUT))
Log(ledPin)
Do While True
Gpio.RunMethod("digitalWrite", Array(ledPin, HIGH)) ' Make GPIO output HIGH level
Log("ON")
Sleep(1000)
Gpio.RunMethod("digitalWrite", Array(ledPin, LOW)) ' //Make GPIO output LOW level
Log("OFF")
Sleep(1000)
Loop
End Sub