VIM 4 GPIO Configuration to RPI

Which system do you use? Android, Ubuntu, OOWOW or others?

Ubuntu

Which version of system do you use? Please provide the version of the system here:

5.15.137 Ubuntu 24.04

Please describe your issue below:

Hi, I would like to configure the GPIO on the khadas VIM 4 to match something similar to RPI 4 GPIO, so that I am able to use RPI HAT/Repo that uses RPI GPIO. May I know if this is possible? If so, how can I achieve it? I am quite new to the hardware configuration, I have read Device Tree Overlay [Khadas Docs] but still have no idea what to write in the .dts file. The repo I am trying to get working is this GitHub - hzeller/rpi-rgb-led-matrix: Controlling up to three chains of 64x64, 32x32, 16x32 or similar RGB LED displays using Raspberry Pi GPIO.

Would appreciate if someone can guide me on this because I am currently in a rush to finish the project, but the hardware portion of this is setting me back as I dont have enough experience with it.

Hello @WongTX

Maybe you can try this: VIM4 WiringPi [Khadas Docs]

Hello @numbqq

I set the GPIO pin to out using “gpio mode X out” because I cant do it via WiringPi python.
When I tried running this

def clock_pulse(self):
“”“Send a clock pulse”“”
wpi.digitalWrite(HUB75_PINS[‘CLK’], 1)
wpi.digitalWrite(HUB75_PINS[‘CLK’], 0)

def latch_data(self):
    """Latch the shift register data"""
    wpi.digitalWrite(HUB75_PINS['LAT'], 1)
    wpi.digitalWrite(HUB75_PINS['LAT'], 0)

def test_all_color(self, r1, g1, b1, r2, g2, b2, duration=2):
“”“Fill panel with solid color”“”
print(f"Testing color R1={r1},G1={g1},B1={b1}, R2={r2},G2={g2},B2={b2}")

    start_time = time.time()
    while time.time() - start_time < duration:
        for row in range(PANEL_HEIGHT // 2):
            self.set_address(row)
            
            # Shift out data for entire row
            for col in range(PANEL_WIDTH):
                self.set_rgb(r1, g1, b1, r2, g2, b2)
                self.clock_pulse()
            
            self.latch_data()
            self.enable_output(True)
            time.sleep(0.001)  # Brief display time
            self.enable_output(False)

nothing seems to happen, when I try the test_all_color function. What are the ways I can troubleshoot this?

I managed to solve it, thank you. If anyone need the code, can ping me

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.