-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Unblocking analogbufio #9225
Comments
Generally I like the model of allocating the large chunk of memory outside of the object. That way you can reuse it in a different object if you really want to. In the Python API, I would expose the indices though. Instead, make an iterator available to get the next value. Take a look at PulseIn for an example. I'd also suggest adding this to a new module so we don't need to include it everywhere |
Closing in favor of #2676. |
Currently
analogbufio.BufferedIn
blocks until the number of samples requested have been collected. I'm working on a non-blocking ring buffered version which will enable continuous data transfer. It could work like this:Or the RingIn could allocate the array itself, e.g.
adcbuf = analogbufio.RingIn(board.GP26, sample_rate=rate, length=length)
Wondering what advice you could offer regarding creation and management of persistent objects like this?The text was updated successfully, but these errors were encountered: