not working esp32
Opened this issue · 4 comments
exec(open('test_ambient.py').read(),globals())
Traceback (most recent call last):
File "", line 1, in
File "", line 10, in
File "apds9960/device.py", line 41, in init
File "apds9960/exceptions.py", line 3, in init
AttributeError: type object 'Exception' has no attribute 'init'
exec(open('test_ambient.py').read(),globals()) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "<string>", line 10, in <module> File "apds9960/device.py", line 41, in __init__ File "apds9960/exceptions.py", line 3, in __init__ AttributeError: type object 'Exception' has no attribute '__init__'
There seems to be a problem to get an instance of the ADPS9960InvalidDevId
class. The I2C device ID of your APDS9960 is missing in
python-apds9960/apds9960/const.py
Lines 9 to 10 in 938fab1
It should work if you put the device ID into the well-known list (and your APDS9960 is compatible). Feel free to open a merge request after you have verified the device ID.
hi everyone,
this is the problem with I2C parameters
replace the code with
bus = I2C(-1, scl = Pin(22), sda = Pin(21))
this will work.
apds.setProximityIntLowThreshold(0)
apds.setProximityIntHighThreshold(200)
apds.setGestureEnterThresh(0)
apds.setGestureExitThresh(200)
apds.setGestureLEDDrive(APDS9960_LED_DRIVE_50MA)
apds.setGestureGain(APDS9960_GGAIN_2X)
apds.enableGestureSensor()