Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not working esp32 #10

Open
coffice12 opened this issue Sep 20, 2019 · 4 comments
Open

not working esp32 #10

coffice12 opened this issue Sep 20, 2019 · 4 comments
Labels

Comments

@coffice12
Copy link

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'

@coffice12
Copy link
Author

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__'

@liske liske added the bug label Sep 21, 2019
@liske
Copy link
Owner

liske commented Sep 21, 2019

There seems to be a problem to get an instance of the ADPS9960InvalidDevId class. The I2C device ID of your APDS9960 is missing in

# APDS9960 device IDs
APDS9960_DEV_ID = [0xab, 0x9c, 0xa8, -0x55]

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.

@nikhilabhi
Copy link

nikhilabhi commented Feb 7, 2020

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.

@lijutsang
Copy link

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()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants