Relay Driver Shields need both to work together

Hi all,

So I'm having some issues with my current project. I'm using 2x Freetronics 8-Channel Relay Driver Shields 8-Channel Relay Driver Shield | Freetronics

I'm making a silicone robot with 5 sections which are 4 limbs and 1 torso, each section uses 3 relays. 1 relay for the air pump and 2 relays for the solenoid values, that means I need 15 relays/switches. Each shield has 8 relays so I have 16 relays to play around with.

I can get each shield working individually, but not together. In the setup code below I have:

Wire.beginTransmission(Driver1);
Wire.beginTransmission(Driver2);

The last line is overwriting the previous. I'm probably making a rookie mistake, but can't see it.
The drivers can stack on top of each other, so there should be a way to make them all work at the same time. Any help will be greatly appreciated as the stress in finishing this project is coming real, haha.

Does anyone know how to resolve this please?

Let me know if I'm not being clear enough or you need more info.

#include "Wire.h"

#define Driver1 0x20 // 0x20 is the address with all jumpers removed
#define Driver2 0x22 //

void setup()
{

Serial.begin( 38400 );
Serial.println("RELAY8 demonstration starting up");

Wire.begin(); // Wake up I2C bus

// Set I/O bank A to outputs
Wire.beginTransmission(Driver1);
Wire.beginTransmission(Driver2);

Wire.write(0x00); // IODIRA register
Wire.write(0x00); // Set all of bank A to outputs

Wire.endTransmission();

}

void loop()
{
sendValueToLatch(Driver1, 1);
sendValueToLatch(Driver2, 1);

}

void sendValueToLatch(int driver, int latchValue)
{
Wire.beginTransmission(driver);
Wire.write(0x12); // Select GPIOA
Wire.write(latchValue); // Send value to bank A
Wire.endTransmission();
}

Try:

  // Set I/O bank A to outputs
  Wire.beginTransmission(Driver1);
 
  Wire.write(0x00); // IODIRA register
  Wire.write(0x00); // Set all of bank A to outputs

  Wire.endTransmission();

  // Set I/O bank A to outputs
  Wire.beginTransmission(Driver2);
 
  Wire.write(0x00); // IODIRA register
  Wire.write(0x00); // Set all of bank A to outputs

  Wire.endTransmission();

My man! I love you dude! Haha. I knew it was a rookie mistake.

Thank you soooooooooo much.

Syn:
My man! I love you dude! Haha. I knew it was a rookie mistake.

Thank you soooooooooo much.

You're welcome. Glad I could help.