2121**Software and Dependencies:**
2222
2323* Adafruit CircuitPython firmware for the supported boards:
24- https://github.com/adafruit/circuitpython/releases
24+ https://circuitpython.org/downloads
2525
2626
27- * Adafruit's Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice
28- * Adafruit's Register library: https://github.com/adafruit/Adafruit_CircuitPython_Register
27+ * Adafruit's Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice
28+ * Adafruit's Register library: https://github.com/adafruit/Adafruit_CircuitPython_Register
2929"""
3030
3131from micropython import const
@@ -104,10 +104,9 @@ class VCNL4040: # pylint: disable=too-few-public-methods
104104
105105 import time
106106 import board
107- import busio
108107 import adafruit_vcnl4040
109108
110- i2c = busio .I2C(board.SCL, board.SDA )
109+ i2c = board .I2C()
111110 sensor = adafruit_vcnl4040.VCNL4040(i2c)
112111
113112 while True:
@@ -128,8 +127,8 @@ class VCNL4040: # pylint: disable=too-few-public-methods
128127 """Interrupt enable. Interrupt setting are close, away, close and away, or disabled. Options
129128 are: PS_INT_DISABLE, PS_INT_CLOSE, PS_INT_AWAY, PS_INT_CLOSE_AWAY."""
130129 proximity_bits = RWBit (0x03 , 11 , register_width = 2 )
131- """Proximity data output setting. ``0`` when proximity sensor output is 12 bits, ``1`` when
132- proximity sensor output is 16 bits."""
130+ """Proximity data output setting. :const:`0` when proximity sensor output is 12 bits,
131+ :const:`1` when proximity sensor output is 16 bits."""
133132
134133 # PS_THDL_LM - PS low interrupt threshold setting
135134 proximity_low_threshold = UnaryStruct (0x06 , "<H" )
@@ -178,10 +177,9 @@ def lux(self):
178177
179178 import time
180179 import board
181- import busio
182180 import adafruit_vcnl4040
183181
184- i2c = busio .I2C(board.SCL, board.SDA )
182+ i2c = board .I2C()
185183 sensor = adafruit_vcnl4040.VCNL4040(i2c)
186184
187185 while True:
@@ -208,10 +206,9 @@ def light_integration_time(self):
208206
209207 import time
210208 import board
211- import busio
212209 import adafruit_vcnl4040
213210
214- i2c = busio .I2C(board.SCL, board.SDA )
211+ i2c = board .I2C()
215212 sensor = adafruit_vcnl4040.VCNL4040(i2c)
216213
217214 sensor.light_integration_time = sensor.ALS_640MS
@@ -234,7 +231,7 @@ def light_integration_time(self, new_it):
234231 sleep (it_delay_seconds )
235232
236233 light_interrupt = RWBit (0x00 , 1 , register_width = 2 )
237- """Ambient light sensor interrupt enable. `` True`` to enable, and `` False` ` to disable."""
234+ """Ambient light sensor interrupt enable. `True` to enable, and `False` to disable."""
238235
239236 # ALS_THDL_LM - ALS low interrupt threshold setting
240237 light_low_threshold = UnaryStruct (0x02 , "<H" )
@@ -266,10 +263,9 @@ def white(self):
266263
267264 import time
268265 import board
269- import busio
270266 import adafruit_vcnl4040
271267
272- i2c = busio .I2C(board.SCL, board.SDA )
268+ i2c = board .I2C()
273269 sensor = adafruit_vcnl4040.VCNL4040(i2c)
274270
275271 while True:
@@ -281,7 +277,7 @@ def white(self):
281277 # PS_MS - White channel enable/disable, PS mode, PS protection setting, LED current
282278 # White_EN - PS_MS_H, 7th bit - White channel enable/disable
283279 white_shutdown = RWBit (0x04 , 15 , register_width = 2 )
284- """White light channel shutdown. When `` True` `, white light data is disabled."""
280+ """White light channel shutdown. When `True`, white light data is disabled."""
285281
286282 def __init__ (self , i2c , address = 0x60 ):
287283 self .i2c_device = i2cdevice .I2CDevice (i2c , address )
0 commit comments