[Solved]OLED display hat for pi connection with arduino

Is there a way to confirm the code can detect something, by putting something to the i2c ports?

Yes, another i2c device! Perhaps an rtc or sensor for example.

Try adding 2K2 pullup resistors between the i2c lines and 3.3V.

Did you get SDA & SCL the right way around? Try swapping them, it is safe to do that.

I wouldn't trust stranded cables pushed into the sockets to make good connections. I would use solid core cable or male-to-male dupont cables.