Question about sketch, addressing boards.

Got comments, questions, or tips about any of the shields listed on ShieldList.org? Post them here!
Post Reply
bigd003
Posts: 10
Joined: Thu Apr 14, 2016 2:30 am

Question about sketch, addressing boards.

Post by bigd003 » Sun Apr 17, 2016 1:31 pm

Hello,

In this Superhouse.tv sketch for the relay 8 boards, Jon Oxer uses 2 relay 8 boards. The addresses are 0x20 and 0x21, but I am having difficulty understanding how the code works, as the 2nd board (0x21) is never really addressed... ->

// Set addressing style
Wire.beginTransmission(shieldAddress);
Wire.write(0x12);
Wire.write(0x20); // use table 1.4 addressing
Wire.endTransmission();

But I was wondering should there be a line for "Wire.write(0x21); // use table 1.4 addressing" ?

Note: Even without the line, both relays work and all outputs are independent, I am just very puzzled about why one shield can be mentioned but not the other, and this would come into play as I add relay shields.

Can anyone help me break this down?
Attachments
superhouse original.txt
(10.72 KiB) Downloaded 46 times

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest