Skip to content

Commit 9831264

Browse files
authored
Add a note on using alternative I2C ports
1 parent be05de4 commit 9831264

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,19 @@ necessary:
4848
from the sensor, but return the values read last. To read a new sample, make
4949
sure to call `readSample()`
5050

51+
### Using an custom or alternative I2C port/Wire instance
52+
53+
Some Arduino boards have multiple predefined I2C ports; generally, the second port will be called `Wire1`.
54+
55+
The `arduino-sht` library allows to use an alternative interface; to do so, pass the port you want to use as an argument to `sht.init()`, like this:
56+
```
57+
if (sht.init(Wire1)) {
58+
Serial.print("init(): success\n");
59+
} else {
60+
Serial.print("init(): failed\n");
61+
}
62+
```
63+
5164
## Example projects
5265

5366
See example project

0 commit comments

Comments
 (0)