Gesture and register control refactor #38
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closed in favor of proceeding with #39, which implements similar changes much more efficiently
Note: This includes the changes in #37 as well.
If anyone wants to follow my trail down the rabbit hole with this sensor I've been keeping updated notes, including a Jupyter Notebook illustrating processing of gesture data.
https://github.com/fivesixzero/circuitpython-experiments/tree/main/clue-nrf52/apds9960-testing
Apologies for the big PR here. While testing my prior PRs I ran into a bunch of unexpected behavior in the driver/sensor that led me to dive in for over a week. Its been a useful learning exercise and I'm hoping that the dozens of hours I've sunk into getting to know this sensor can be useful to the community!
With that in mind, I've refactored gesture engine to address several problems in the current driver code.
Here are the primary issues this PR is aiming to address:
gesture()
call, effectively locking up the sensor until power cyclepersistence
is spelledpersistance
throughout the driver. This is an understandable misspelling since the datasheet misspells the word almost every time it shows up. This is even true of the updated 2015 version of the datasheet which fixes a ton of typos and formatting errors but left the misspelling in all of the flowcharts. 😂In addition to addressing the above this PR includes improvements in a few other areas.
keypad
example but, with proper configuration, this sensor can be used for a bunch of other interesting things without needing to grok the internalsThere are still some items to discuss and address before this can be moved out of draft state. I'm hoping reviewers can add to this list as well. :)
SAMD21
.basic
(ie, proximity only) andadvanced
(color, gesture) classes/subclasses, similar to the BME280 driver