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

Gesture Sensing & Code Blocking #29

Open
epiller opened this issue Apr 28, 2021 · 3 comments
Open

Gesture Sensing & Code Blocking #29

epiller opened this issue Apr 28, 2021 · 3 comments

Comments

@epiller
Copy link

epiller commented Apr 28, 2021

Is there any possibility to make the gesture sensing non-blocking? At the moment, when gestures are enabled and something is in close proximity of the sensor, everything in the program is blocked.
Assuming there's no blocking functions in the user's code, could a function, say, "apds.update()" that's running in the loop function achieve the same functionality without blocking everything else?
Is this a sensor hardware/firmware limitation or just the way the library was written?

@Brok0lis
Copy link

@epiller There is a while loop in readGesture(). I think that is the issue. I also find the blocking part annoying, but it is also present in the SparkFun library. What I am considering is trying to rewrite it somehow, but I would like to think that it is not as easy as I suspect, since apparently 2 sets of engineers have written a blocking implementation.

The weird thing to me is that ADC conversion for 2 pairs takes 1.3ms according to the datasheet, and FIFO can hold 32 datasets, so why would it be written blocking? Even with 16Mhz on something like an arduino you should have plenty of time to read it every now and then. If I make something sensible I will leave a message here.

@ladyada
Copy link
Member

ladyada commented May 16, 2021

if someone can do a PR where the engine uses the FIFO that would be great!

@epiller
Copy link
Author

epiller commented May 16, 2021

@Brok0lis Would be pretty awesome if you could pull that off, especially since the same changes could be made on the SparkFun library as well! Keep us posted

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

No branches or pull requests

3 participants