The software architecture
The application code for our gesture controller is going to be simple. The application needs to first instantiate a gesture object and tell it which I2C bus the APDS-9960 is located on. Once the gesture controller object has been created, we simply make a call to the object's gesture status method to determine whether a gesture is present or not. If one is present, then we get the gesture that was detected, which then updates the LEDs based on the detected gesture. When we receive a new gesture, we want that gesture to stay on the LEDs for several seconds before it disappears.
After we receive a new valid gesture, we will signal to the application that we want to latch the LEDs. The actual mechanism used to control ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access