We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents c9cb4cc + dbb04b6 commit 8fc168fCopy full SHA for 8fc168f
Adafruit_VCNL4000/Adafruit_VCNL4000.py
@@ -51,4 +51,11 @@ def read_proximity(self):
51
return self.i2c.readU16(VCNL4000_PROXIMITYDATA)
52
time.sleep(0.001)
53
54
-
+ # Read data from ambient sensor
55
+ def read_ambient(self):
56
+ self.i2c.write8(VCNL4000_COMMAND, VCNL4000_MEASUREAMBIENT)
57
+ while True:
58
+ result = self.i2c.readU8(VCNL4000_COMMAND)
59
+ if (result and VCNL4000_AMBIENTREADY):
60
+ return self.i2c.readU16(VCNL4000_AMBIENTDATA)
61
+ time.sleep(0.001)
0 commit comments