Skip to content

Commit 4b9ba69

Browse files
committed
Corrected 'and' keyword to '&' operator
1 parent ab9b67b commit 4b9ba69

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Adafruit_VCNL4000/Adafruit_VCNL4000.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def read_proximity(self):
4747
self.i2c.write8(VCNL4000_COMMAND, VCNL4000_MEASUREPROXIMITY)
4848
while True:
4949
result = self.i2c.readU8(VCNL4000_COMMAND)
50-
if (result and VCNL4000_PROXIMITYREADY):
50+
if (result & VCNL4000_PROXIMITYREADY):
5151
return self.i2c.readU16(VCNL4000_PROXIMITYDATA)
5252
time.sleep(0.001)
5353

@@ -56,6 +56,6 @@ def read_ambient(self):
5656
self.i2c.write8(VCNL4000_COMMAND, VCNL4000_MEASUREAMBIENT)
5757
while True:
5858
result = self.i2c.readU8(VCNL4000_COMMAND)
59-
if (result and VCNL4000_AMBIENTREADY):
59+
if (result & VCNL4000_AMBIENTREADY):
6060
return self.i2c.readU16(VCNL4000_AMBIENTDATA)
6161
time.sleep(0.001)

0 commit comments

Comments
 (0)