diff --git a/library.properties b/library.properties index 52ede10..b79f201 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=Vishay_VCNL4200 -version=1.1.0 +version=1.1.1 author=Kevin Tsai maintainer=Kevin Tsai sentence=Vishay VCNL4200 Long Range Proximity and Ambilent Light Sensor. diff --git a/src/VCNL4200.cpp b/src/VCNL4200.cpp index 909bfe8..757fc47 100644 --- a/src/VCNL4200.cpp +++ b/src/VCNL4200.cpp @@ -138,13 +138,13 @@ boolean VCNL4200Class::read(uint8_t reg, uint16_t *data) boolean VCNL4200Class::write(uint8_t reg, uint16_t data) { - boolean status = true; + boolean status = false; _wire->beginTransmission(slaveAddress); if ((_wire->write(reg) == 1) && (_wire->write((uint8_t)(data & 0xFF)) == 1) && (_wire->write((uint8_t)((data >> 8) & 0xFF)) == 1)) - status = false; + status = true; _wire->endTransmission(true); return status;