B4J Question Raspberry Pi 4B GPIO Not working

Status
Not open for further replies.

fredeady

Member
Licensed User
I can't get an LED to toggle on any of the Pi's GPIO pins.
I see that Gordon has updated wiredPi but no longer supports it.
I loaded his latest version 2.52 on the Pi. Buster comes with 2.50.
I loaded up the Debian Pi4J jar on the Pi and am using the B4J library.
I feel sort of dumb as I can't seem to make this work.
I know I'm missing something. My Pi is running Buster. I can toggle
the LED using Python. I am currently trying to toggled GPIO 27, which is
physical pin 13. Thanks for any enlightenment.
 

Erel

Administrator
Staff member
Licensed User
The situation with Pi4J / WiringPi and Raspberry Pi 4 is not very good as the developer of WiringPi stopped developing it.

However I'm able to control a led with RPi 4.

Steps I followed:

B4X:
Sub Process_Globals
    Private controller As GpioController
    Private p As GpioPinDigitalOutput
End Sub

Sub AppStart (Args() As String)
    Log("test")
    controller.Initialize
    p.Initialize(15, False)
    test
    StartMessageLoop
End Sub

Sub test
    Dim b As Boolean
    Do While True
        p.State = b
        b = Not(b)
        Log(b)
        Sleep(1000)
    Loop
End Sub

Pins: https://pi4j.com/1.2/pins/model-b-plus.html
 
Upvote 0
Status
Not open for further replies.
Top