Skip to content

Commit

Permalink
Bug fixed for write() routine.
Browse files Browse the repository at this point in the history
  • Loading branch information
ktsai69 committed Oct 20, 2021
1 parent f74d1ce commit 1dc35ee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
4 changes: 2 additions & 2 deletions src/VCNL4200.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1dc35ee

Please sign in to comment.