It seems that the program installed from factory is much more sensitive (detects at bigger distance) than the Circuitpython sample program (https://learn.adafruit.com/adafruit-pro ... brightness). Would be nice to have some info on how to change the settings.
Since I don't know how to restore the default program I cannot give actual numbers. I would say 30 cm (factory) vs 5 cm (CPY) for start of detection.
Using CPY 8 alpha.
Proximity Trinkey: factory program much more sensitive than
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- mjmare
- Posts: 2
- Joined: Sun Jun 07, 2015 9:50 am
- adafruit_support_carter
- Posts: 29168
- Joined: Tue Nov 29, 2016 2:45 pm
Re: Proximity Trinkey: factory program much more sensitive t
The shipped demo is actually an Arduino sketch. The code for it is here:
https://github.com/adafruit/Adafruit_Le ... o_Demo.ino
Here's a summary of the initialization done to the APDS:
The APDS9960 CircuitPython library is here:
https://github.com/adafruit/Adafruit_Ci ... n_APDS9960
documentation here:
https://docs.circuitpython.org/projects ... en/latest/
https://github.com/adafruit/Adafruit_Le ... o_Demo.ino
Here's a summary of the initialization done to the APDS:
Code: Select all
apds.enableProximity(true);
apds.setProxGain(APDS9960_PGAIN_8X);
apds.setLED(APDS9960_LEDDRIVE_100MA, APDS9960_LEDBOOST_300PCNT);
apds.setProxPulse(APDS9960_PPULSELEN_16US, 1);
//set the interrupt threshold to fire when proximity reading goes above 2
apds.setProximityInterruptThreshold(0, 2);
apds.enableProximityInterrupt();
https://github.com/adafruit/Adafruit_Ci ... n_APDS9960
documentation here:
https://docs.circuitpython.org/projects ... en/latest/
- mjmare
- Posts: 2
- Joined: Sun Jun 07, 2015 9:50 am
Re: Proximity Trinkey: factory program much more sensitive t
Thx Carter, your answer suggested some gain factor, which I managed to find in the CPY source code: APDS9960.proximity_gain.
When set to 3 (=8x=max) I noticed a definite improvement: the detection distances improves from about 5cm to about 20cm.
PS proximity_gain is not documented ASAICT.
Thanks for the help.
When set to 3 (=8x=max) I noticed a definite improvement: the detection distances improves from about 5cm to about 20cm.
PS proximity_gain is not documented ASAICT.
Thanks for the help.
Please be positive and constructive with your questions and comments.