Skip to content

Commit

Permalink
Add a note on using alternative I2C ports
Browse files Browse the repository at this point in the history
  • Loading branch information
winkj authored Nov 14, 2023
1 parent be05de4 commit 9831264
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,19 @@ necessary:
from the sensor, but return the values read last. To read a new sample, make
sure to call `readSample()`

### Using an custom or alternative I2C port/Wire instance

Some Arduino boards have multiple predefined I2C ports; generally, the second port will be called `Wire1`.

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:
```
if (sht.init(Wire1)) {
Serial.print("init(): success\n");
} else {
Serial.print("init(): failed\n");
}
```

## Example projects

See example project
Expand Down

0 comments on commit 9831264

Please sign in to comment.