Skip to content

Commit 756f9d8

Browse files
authored
Merge pull request #34 from fivesixzero/remove-unused-interrupt-pin-arg
Remove unused interrupt pin arg and doc updates
2 parents 2543d0d + ef02f6e commit 756f9d8

File tree

3 files changed

+14
-17
lines changed

3 files changed

+14
-17
lines changed

README.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Usage Example
6464
6565
i2c = board.I2C()
6666
int_pin = digitalio.DigitalInOut(board.D5)
67-
apds = APDS9960(i2c, interrupt_pin=int_pin)
67+
apds = APDS9960(i2c)
6868
6969
apds.enable_proximity = True
7070
apds.proximity_interrupt_threshold = (0, 175)
@@ -99,7 +99,7 @@ pin for proximity detection.
9999
100100
int_pin = digitalio.DigitalInOut(board.A1)
101101
i2c = board.I2C()
102-
apds = APDS9960(i2c, interrupt_pin=int_pin)
102+
apds = APDS9960(i2c)
103103
104104
Gestures
105105
--------

adafruit_apds9960/apds9960.py

+11-14
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,15 @@
1919
* Adafruit `APDS9960 Proximity, Light, RGB, and Gesture Sensor
2020
<https://www.adafruit.com/product/3595>`_ (Product ID: 3595)
2121
22+
* Adafruit `Adafruit CLUE
23+
<https://www.adafruit.com/product/4500>`_ (Product ID: 4500)
24+
25+
* Adafruit `Adafruit Feather nRF52840 Sense
26+
<https://www.adafruit.com/product/4516>`_ (Product ID: 4516)
27+
28+
* Adafruit `Adafruit Proximity Trinkey
29+
<https://www.adafruit.com/product/5022>`_ (Product ID: 5022)
30+
2231
**Software and Dependencies:**
2332
2433
* Adafruit CircuitPython firmware for the supported boards:
@@ -27,7 +36,6 @@
2736
* Adafruit's Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice
2837
"""
2938
import time
30-
import digitalio
3139
from adafruit_register.i2c_bits import RWBits
3240
from adafruit_register.i2c_bit import RWBit
3341
from adafruit_bus_device.i2c_device import I2CDevice
@@ -97,8 +105,7 @@ class APDS9960:
97105
"""
98106
APDS9900 provide basic driver services for the ASDS9960 breakout board
99107
100-
:param ~busio.I2C i2c: The I2C bus the BME280 is connected to
101-
:param ~microcontroller.Pin interrupt_pin: Interrupt pin. Defaults to `None`
108+
:param ~busio.I2C i2c: The I2C bus the ASDS9960 is connected to
102109
:param int address: The I2C device address. Defaults to :const:`0x39`
103110
:param int integration_time: integration time. Defaults to :const:`0x01`
104111
:param int gain: Device gain. Defaults to :const:`0x01`
@@ -136,23 +143,13 @@ class APDS9960:
136143
_proximity_persistance = RWBits(4, APDS9960_PERS, 4)
137144

138145
def __init__(
139-
self,
140-
i2c,
141-
*,
142-
interrupt_pin=None,
143-
address=0x39,
144-
integration_time=0x01,
145-
gain=0x01,
146-
rotation=0
146+
self, i2c, *, address=0x39, integration_time=0x01, gain=0x01, rotation=0
147147
):
148148

149149
self.buf129 = None
150150
self.buf2 = bytearray(2)
151151

152152
self.i2c_device = I2CDevice(i2c, address)
153-
self._interrupt_pin = interrupt_pin
154-
if interrupt_pin:
155-
self._interrupt_pin.switch_to_input(pull=digitalio.Pull.UP)
156153

157154
if self._read8(APDS9960_ID) != 0xAB:
158155
raise RuntimeError()

examples/apds9960_proximity_simpletest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
i2c = board.I2C()
99
int_pin = digitalio.DigitalInOut(board.D5)
10-
apds = APDS9960(i2c, interrupt_pin=int_pin)
10+
apds = APDS9960(i2c)
1111

1212
apds.enable_proximity = True
1313
apds.proximity_interrupt_threshold = (0, 175)

0 commit comments

Comments
 (0)