How to connect non-grove devices through a grove base shield

Hi, I’m very new to using the pynq board and am just trying to set up some simple projects by following along with some tutorials I found online.

I’m using a pyng z2 board image version [v3.0.1]
I have a Grove base shield v2 connected to the Arduino pins

currently, I’m trying to control a grove LEDbar (v2.1) based on distances calculated using a HC-sr04 ultrasound device.

I have the LEDbar connected to port D6 of the base shield and the ultrasound device connected to Arduino pins 3 and 2 also through the base shield.

I can control each device separately perfectly fine but when I upload the libraries to control both at once one device stops functioning.

this is the code I’m using

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
import time
from pynq.overlays.base import BaseOverlay

//led bar control
from pynq_peripherals import ArduinoSEEEDGroveAdapter

//ultrasound sensor control
from pynq.lib.arduino import arduino_io
from pynq.lib.arduino import Arduino_Analog

from time import sleep

base = BaseOverlay(“base.bit”)

adapter=ArduinoSEEEDGroveAdapter(base.ARDUINO, D6=‘grove_ledbar’)

ledbar = adapter.D6

trig = arduino_io.Arduino_IO(base.iop_arduino.mb_info, 3, ‘out’)
echo = arduino_io.Arduino_IO(base.iop_arduino.mb_info, 2, ‘in’)
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

I was just hoping someone could help me understand why it’s breaking at this stage and how I might go about fixing it, for example, is the a way to write/ read directly to the pins of a base shield port eg pins D3, D2 of port D2?

thank you in advance and apologize if it’s an overly simplistic question I’ve found it hard to find many comprehensive guides on using the pynq board online.