Replacing the robot hat v4

The RGB 4-pin wire into the robot hat for my Pi Dog sheared off the robot hat and is now unusable. I have to replace the robot hat (which meant purchasing a whole new Pi Dog because no robot hat v4s can be found on line). Will I have to reinstall all the lines of code once I place the new robot hat on the Raspberry Pi 4 B board?

No, everything should work just fine after the swap

The broken rgb connector is the i2c interface. The robot hat has 2 i2c interfaces. You’d just need a different cable to use the second one instead

and change the initialization code .
Sunfounder may be able to suggest any code change needed.

I can only find one i2c interface on my robot hat v4. Where is the second one?

Bottom left

Thanks! If I use this on the robot hat that has the broken connector, what code do I need to send to reprogram for the RGB device? Or can I just plug in the new wire?

I do not know. I2c is a parallel interface. It may require a simple remapping or maybe nothing if its physically the same interface on the robot hat.

Rpi has potentially 6 i2c interfaces, but I do not know how Sunfounder have mapped these to their hat.

I could run through the code myself to work it out but I’d suggest to await Sunfounder to return to the office tomorrow and see what they suggest

I have to be honest though. I have found minimal use for the imu and less so for the rgb, so I would personally just bypass their initialization routines and work without them, especially if I had to spend $$$ ! I don’t like spending money :confused:

I’ll wait. Thank you. In the meantime, the robot hat from the second PiDog works just fine after I swapped it for the broken one in the first PiDog. Now I have two PiDogs to work with.

1 Like

The V4 documentation suggests that these interfaces are physically identical, i.e parallel wiring of just 2 gpios.

"These I2C interfaces are connected to the Raspberry Pi’s I2C interface via GPIO2 (SDA) and GPIO3 (SCL). "

So in theory you should be able to just buy the new cable that I mentioned and no software changes needed.