We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ab9b67b commit 4b9ba69Copy full SHA for 4b9ba69
Adafruit_VCNL4000/Adafruit_VCNL4000.py
@@ -47,7 +47,7 @@ def read_proximity(self):
47
self.i2c.write8(VCNL4000_COMMAND, VCNL4000_MEASUREPROXIMITY)
48
while True:
49
result = self.i2c.readU8(VCNL4000_COMMAND)
50
- if (result and VCNL4000_PROXIMITYREADY):
+ if (result & VCNL4000_PROXIMITYREADY):
51
return self.i2c.readU16(VCNL4000_PROXIMITYDATA)
52
time.sleep(0.001)
53
@@ -56,6 +56,6 @@ def read_ambient(self):
56
self.i2c.write8(VCNL4000_COMMAND, VCNL4000_MEASUREAMBIENT)
57
58
59
- if (result and VCNL4000_AMBIENTREADY):
+ if (result & VCNL4000_AMBIENTREADY):
60
return self.i2c.readU16(VCNL4000_AMBIENTDATA)
61
0 commit comments