Skip to content

Commit

Permalink
init should not set I2C addr to 0
Browse files Browse the repository at this point in the history
init takes sdaPin and clkPin but does not take an I2C address.  Therefore the call to init should not set the I2C address to 0.  It should leave it alone.
  • Loading branch information
billdenbeste committed Dec 21, 2018
1 parent c48cb19 commit 2f13d74
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cpp_utils/PCF8574.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,5 +116,6 @@ void PCF8574::setInvert(bool value) {
* @param [in] clkPin The pin to use for the %I2C CLK functions.
*/
void PCF8574::init(gpio_num_t sdaPin, gpio_num_t clkPin) {
i2c->init(0, sdaPin, clkPin);
uint8_t addr = i2c->getAddress();
i2c->init(addr, sdaPin, clkPin);
} // init

0 comments on commit 2f13d74

Please sign in to comment.