I have 6 16 Channel realy boards. I use them with Arduino mega.
Some of works fine, some of not! My code is same.
Wire.beginTransmission(0x20); Wire.write(0x00); // IODIRA register Wire.write(0xff); // set entire PORT A as output Wire.endTransmission();
if i use this code, all relay closes. if i write;
Wire.beginTransmission(0x20); Wire.write(0x00); // IODIRA register Wire.write(0b11111110); // triggers first relay Wire.endTransmission();
with this code, you trigger relay 1 on port A. if u write 0b11111101 as address you trigger relay 2.
But in one relay board, some off address triggers another relay too. For example if i want to trigger first relay and write address as 0b11111110 it triggers second relay too. (another relay boards it don't happens)
You will probably say, "check wires", yeah i checked million times, all are true. My code is true, because it works well on other relay boards. And this board runs successfully 1 week ago. and now not!
What am i asking?
I use different function on this relay board several days ago. board i2c address is still same, port addresses are same, but i am affraid, relay address could be changed because of this code? Is there anyway to reverse default case?