We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents f1db826 + 6c5f64e commit 5373f4fCopy full SHA for 5373f4f
I2C_Multiple_Same_Address/arduino/multi_tca_2x/multi_tca_2x.ino
@@ -22,12 +22,13 @@ void tcaselect(uint8_t tca, uint8_t channel) {
22
// loop over all TCA's
23
for (uint8_t i=0; i<TCA_COUNT; i++) {
24
Wire.beginTransmission(TCA_ADDRESSES[i]);
25
- if (i == tca)
+ if (i == tca) {
26
// set output channel for selected TCA
27
Wire.write(1 << channel);
28
- else
+ } else {
29
// for others, turn off all channels
30
Wire.write(0);
31
+ }
32
Wire.endTransmission();
33
}
34
@@ -74,4 +75,4 @@ void loop() {
74
75
Serial.print("BME280 #3 Pressure = "); Serial.println(pressure3);
76
77
delay(1000);
-}
78
+}
0 commit comments