Skip to content

Commit 5373f4f

Browse files
authored
Merge pull request #2348 from caternuson/multi_tca_code
Add curlies
2 parents f1db826 + 6c5f64e commit 5373f4f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

I2C_Multiple_Same_Address/arduino/multi_tca_2x/multi_tca_2x.ino

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,13 @@ void tcaselect(uint8_t tca, uint8_t channel) {
2222
// loop over all TCA's
2323
for (uint8_t i=0; i<TCA_COUNT; i++) {
2424
Wire.beginTransmission(TCA_ADDRESSES[i]);
25-
if (i == tca)
25+
if (i == tca) {
2626
// set output channel for selected TCA
2727
Wire.write(1 << channel);
28-
else
28+
} else {
2929
// for others, turn off all channels
3030
Wire.write(0);
31+
}
3132
Wire.endTransmission();
3233
}
3334
}
@@ -74,4 +75,4 @@ void loop() {
7475
Serial.print("BME280 #3 Pressure = "); Serial.println(pressure3);
7576

7677
delay(1000);
77-
}
78+
}

0 commit comments

Comments
 (0)