diff --git a/rotaryDecoder.cpp b/rotaryDecoder.cpp index 3506130..23dc01f 100644 --- a/rotaryDecoder.cpp +++ b/rotaryDecoder.cpp @@ -188,9 +188,9 @@ uint8_t rotaryDecoder::_read8() bool rotaryDecoder::_write8(uint8_t value) { - _wire->beginTransmission(address); + _wire->beginTransmission(_address); _wire->write(value); - return (_wire->endTransmission == 0); + return (_wire->endTransmission() == 0); } diff --git a/rotaryDecoder.h b/rotaryDecoder.h index 6025816..300cf28 100644 --- a/rotaryDecoder.h +++ b/rotaryDecoder.h @@ -54,6 +54,7 @@ class rotaryDecoder int32_t _encoder[4] = { 0, 0, 0, 0 }; uint8_t _read8(); + bool _write8(uint8_t value); uint8_t _address; TwoWire * _wire; };