Skip to content

APDS9960 hangs when sensing gesture #11026

@jmangum

Description

@jmangum

CircuitPython version and board name

Adafruit CircuitPython 10.2.1 on 2026-05-13; Adafruit QT Py ESP32-S3 no psram wi
th ESP32S3

Code/REPL

# APDS9960 gesture sensing test
import board
import displayio
from adafruit_apds9960.apds9960 import APDS9960
from fourwire import FourWire
from adafruit_gc9a01a import GC9A01A
#
i2c = board.STEMMA_I2C()
apds = APDS9960(i2c)

displayio.release_displays()
spi = board.SPI()
# Set tft pins for QTPy EYESPI BFF on ESP32-S3
tft_cs = board.TX
tft_dc = board.RX
tft_reset = None
tft_backlight = board.A1 # Jumpered EyeSpy BFF Lite pin to Qt Py pin A1
tft_bpwmfreq = 50000 # Default is 50000
display_bus = FourWire(spi, command=tft_dc, chip_select=tft_cs, reset=tft_reset)
display = GC9A01A(display_bus, width=240, height=240, backlight_pin=tft_backlight, backlight_pwm_frequency=tft_bpwmfreq)
display.brightness = 1.0 # Turn-on display at start

# Default all APDS sensing to True to allow sensor to enable
apds.enable_gesture = True
apds.enable_color = True
apds.enable_proximity = True # Note that proximity has to be on for gesture to work
# NOTE: For vertical mount, orientation is as follows:
#    gesture = 1: right
#    gesture = 2: left
#    gesture = 3: up
#    gesture = 4: down
count = 0 # For testing
while True:
    gesture = apds.gesture()
    count += 1
    print("count: ",count," gesture: ",gesture)
    if gesture == 1:
        print("right")
        disp.brightness = 1.0
    elif gesture == 2:
        print("left")
        disp.brightness = 0.01
    elif gesture == 3:
        print("up")
        disp.brightness = 1.0
    elif gesture == 4:
        print("down")
        disp.brightness = 0.01
    if gesture != 0: _setgest = gesture

Behavior

count:  10  gesture:  0
Traceback (most recent call last):
  File "code.py", line 34, in <module>
  File "adafruit_apds9960/apds9960.py", line 684, in gesture
KeyboardInterrupt: 
�]0;�192.168.0.66 | BLE:Off | Done | 10.2.1\
Code done running.

Description

  • When APDS9960 senses gesture program hangs (can see count stop in REPL).
  • Need to ctrl-C to exit program aftre hang
  • Removing everything but APDS setup results in same behaviour (i.e. problem does not appear to be associated with display setup).
  • Problem may have existed before 10.2.1 (other communications issues associated with SD card usage may have masked this issue).

Additional information

Note that project configuration includes a QtPy EYESPI BFF

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions