Skip to content

Commit

Permalink
Merge pull request #21 from matsen75/master
Browse files Browse the repository at this point in the history
Added _wire->begin() to Adafruit_MCP9808::begin()
  • Loading branch information
hoffmannjan committed May 15, 2019
2 parents f962296 + 2876e22 commit 2b2dfd1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Adafruit_MCP9808.cpp
Expand Up @@ -66,7 +66,6 @@ bool Adafruit_MCP9808::begin(TwoWire *theWire) {
bool Adafruit_MCP9808::begin(uint8_t addr) {
_i2caddr = addr;
_wire = &Wire;
_wire->begin();
return init();
}

Expand Down Expand Up @@ -97,6 +96,8 @@ bool Adafruit_MCP9808::begin() {
* @return True if initialization was successful, otherwise false.
*/
bool Adafruit_MCP9808::init() {
_wire->begin();

if (read16(MCP9808_REG_MANUF_ID) != 0x0054)
return false;
if (read16(MCP9808_REG_DEVICE_ID) != 0x0400)
Expand Down

0 comments on commit 2b2dfd1

Please sign in to comment.