@@ -56,14 +56,13 @@ To install in a virtual environment in your current project:
5656 Usage Example
5757=============
5858
59- .. code-block :: python
59+ .. code-block :: python3
6060
6161 import board
62- import busio
6362 import digitalio
6463 from adafruit_apds9960.apds9960 import APDS9960
6564
66- i2c = busio .I2C(board. SCL , board. SDA )
65+ i2c = board .I2C()
6766 int_pin = digitalio.DigitalInOut(board.D5)
6867 apds = APDS9960(i2c, interrupt_pin=int_pin)
6968
@@ -85,30 +84,29 @@ Basics
8584
8685Of course, you must import i2c bus device, board pins, and the library:
8786
88- .. code :: python
87+ .. code :: python3
8988
9089
91- from board import SCL , SDA , A1
90+ import board
9291 from adafruit_apds9960.apds9960 import APDS9960
93- import busio
9492 import digitalio
9593
9694 To set-up the device to gather data, initialize the I2CDevice using SCL
9795and SDA pins. Then initialize the library. Optionally provide an interrupt
9896pin for proximity detection.
9997
100- .. code :: python
98+ .. code :: python3
10199
102- int_pin = digitalio.DigitalInOut(A1)
103- i2c = busio .I2C(SCL , SDA )
100+ int_pin = digitalio.DigitalInOut(board. A1)
101+ i2c = board .I2C()
104102 apds = APDS9960(i2c, interrupt_pin=int_pin)
105103
106104 Gestures
107105--------
108106
109107To get a gesture, see if a gesture is available first, then get the gesture Code
110108
111- .. code :: python
109+ .. code :: python3
112110
113111 gesture = apds.gesture()
114112 if gesture == 1:
@@ -126,7 +124,7 @@ Color Measurement
126124To get a color measure, enable color measures, wait for color data,
127125then get the color data.
128126
129- .. code :: python
127+ .. code :: python3
130128
131129 apds.enable_color = True
132130
@@ -141,7 +139,7 @@ Proximity Detection
141139
142140To check for a object in proximity, see if a gesture is available first, then get the gesture Code
143141
144- .. code :: python
142+ .. code :: python3
145143
146144 apds.enable_proximity = True
147145
0 commit comments