Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

CLUE - APDS9960 proximity reading stops
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

CLUE - APDS9960 proximity reading stops

by Aoyama_PROD on Thu Feb 13, 2020 9:35 am

*added the video on Twitter
https://twitter.com/AoyamaProd/status/1227951757994557441

APDS9660 proximity is not working once the proximity >= 51.

just writing as follows;
Code: Select all | TOGGLE FULL SIZE
from adafruit_clue import clue

data = clue.simple_text_display(text_scale=3, colors=(clue.WHITE,))

data[0].text = "Proximity &"
data[1].text = "Gesture"
while True:
    alarm = False
    prox = clue.proximity
    ges = clue.gesture
    data[3].text = "Prox: {}".format(prox)
    data[5].text = "Gesture: {}".format(ges)
   
    data.show()


I'm using CircuitPython 5.0.0-beta.5 and adafruit-circuitpython-bundle-5.x-mpy-20200213.

Is it a know issue for CLUE or specific to my CLUE board?

Aoyama_PROD
 
Posts: 4
Joined: Wed Nov 14, 2018 7:37 am

Re: CLUE - APDS9960 proximity reading stops

by dastels on Thu Feb 13, 2020 11:21 am

I'm seeing the same behavior with the same CircuitPython and bundle.

I'll have a look inside.

Dave

dastels
 
Posts: 3505
Joined: Tue Oct 20, 2015 3:22 pm

Re: CLUE - APDS9960 proximity reading stops

by dastels on Thu Feb 13, 2020 11:36 am

The loop continues to run, but proximity just continues to return 51.

It's in the apds9960 library. Soimething to do with the gesture code.

Line 144 is:
Code: Select all | TOGGLE FULL SIZE
self.gesture_proximity_threshold = 50


Change that to 60 and the prox freezes at 61. Hmmm.

Dave

dastels
 
Posts: 3505
Joined: Tue Oct 20, 2015 3:22 pm

Re: CLUE - APDS9960 proximity reading stops

by dastels on Thu Feb 13, 2020 11:46 am

A workaround.

Add this line just before the while True: loop

Code: Select all | TOGGLE FULL SIZE
clue._sensor.gesture_proximity_threshold = 255


Gestures won't get triggered, but proximity will work.

dastels
 
Posts: 3505
Joined: Tue Oct 20, 2015 3:22 pm

Re: CLUE - APDS9960 proximity reading stops

by Aoyama_PROD on Fri Feb 14, 2020 8:23 pm

Great! Thank you so much for the investigation and the work around! I also get information from @anne_engineer that the APDS9660 library to be updated.

Aoyama_PROD
 
Posts: 4
Joined: Wed Nov 14, 2018 7:37 am

Re: CLUE - APDS9960 proximity reading stops

by shamurai on Sun Aug 09, 2020 3:37 pm

Just came across this same issue which is present in both CircuitPython 5.3.1 and CircuitPython 6.0.0-alpha.2.

Is there some other workaround besides "just don't use gesture and proximity in the same code"?

shamurai
 
Posts: 1
Joined: Fri Nov 10, 2017 9:08 pm

Re: CLUE - APDS9960 proximity reading stops

by dastels on Mon Aug 31, 2020 11:00 am

Please don't hijack existing threads. Create new threads for your questions/issues.

Dave

dastels
 
Posts: 3505
Joined: Tue Oct 20, 2015 3:22 pm

Please be positive and constructive with your questions and comments.