Skip to content

Instantly share code, notes, and snippets.

@PreetSangha
Created September 4, 2018 10:53
Show Gist options
  • Save PreetSangha/f6272837fb49d36ae05e55603f82cb7f to your computer and use it in GitHub Desktop.
Save PreetSangha/f6272837fb49d36ae05e55603f82cb7f to your computer and use it in GitHub Desktop.
;
const int NUMBOARDS = 6;
int address[NUMBOARDS] = {0x21, 0z22, 0x23 ....}
PCF857 board[NUMBOARDS] = {
PCF857(address[0]),
PCF857(address[1]),
PCF857(address[2]),
PCF857(address[3]),
PCF857(address[4]),
PCF857(address[5])
};
void setup() {
}
void loop(){
// addressing each
for(int i = 0; i< NUMBOARDS; ++i) {
... board[i] ... // lets you get each board
... address[i] ... // lets you get each address
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment